Created
October 6, 2016 20:55
-
-
Save krishnachaitanya7/87ab164dafe25a3cd43a5a9e24b9d165 to your computer and use it in GitHub Desktop.
This script can be modded to add some text whenever a key is pressed. DIY whatever satisfies you, you can change keycodes by replacing "13" and 'keyup' can be replaced by 'keypress' & 'keydown' events whichever satisfies your need
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Enter "mnemonic" on pressing enter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://quizlet.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$(document).on("keyup", function (e) { | |
var code = e.keyCode || e.which; | |
if(code == 13) { //Enter keycode | |
//Do something | |
var focused = document.activeElement; | |
focused.value = focused.value + 'mnemonic:'; | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment