Last active
October 9, 2023 10:05
-
-
Save dariusf/c790925f5381eafc50be032da37916f3 to your computer and use it in GitHub Desktop.
Softmark workflow hacks
This file contains 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
// Keybindings for compound rubrics | |
document.onkeypress = function(e) { | |
if (e.key === 'n') { | |
setTimeout(() => { | |
// both events have to be sent | |
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'j'})); | |
document.dispatchEvent(new KeyboardEvent('keyup', {'key': 'j'})); | |
setTimeout(() => { | |
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'k'})); | |
document.dispatchEvent(new KeyboardEvent('keyup', {'key': 'k'})); | |
setTimeout(() => { | |
document.dispatchEvent(new KeyboardEvent('keydown', {'key': 'l'})); | |
document.dispatchEvent(new KeyboardEvent('keyup', {'key': 'l'})); | |
}, 300); // slow enough that events don't disappear and the text doesn't overlap | |
}, 300); | |
}, 300); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment