Created
August 11, 2015 05:22
-
-
Save dovy/57766c892e014082950a to your computer and use it in GitHub Desktop.
This jQuery snipper allows you to make any key combo you want, via codes. Just grab the key codes here: http://keycodes.atjayjo.com/
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
var map = {87: false, 83: false}; // Update checked keys | |
$( document ).keydown( function( e ) { | |
if ( e.keyCode in map ) { | |
map[e.keyCode] = true; | |
if ( map[87] && map[83] ) { // update checking of keys | |
console.log('here'); // Action goes here | |
} | |
} | |
}).keyup(function(e) { | |
if ( e.keyCode in map ) { | |
map[e.keyCode] = false; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment