-
-
Save setkyar/c6fc9302f716bad09493 to your computer and use it in GitHub Desktop.
VIM
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
//Deteact keyboard code when user type to the input | |
$('input').on('keydown', function (e) { | |
console.log(e.keyCode); | |
}) | |
//For esc/i/j and k | |
$(document).keyup(function(e) { | |
if (e.keyCode == 27) { alert('esc') } // esc | |
if (e.keyCode == 73) { alert('i') } // i insert mode | |
if (e.keyCode == 74) { alert('j') } // j left | |
if (e.keyCode == 75) { alert('k') } // k right | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment