javascript - Getting the Name of Key Pressed -
i trying use jquery.hotkeys plugin.
while triggers events on keypress, want know name of key pressed.
so code:
$(document).bind('keydown', 'alt+ctrl+z', mycallback);
i want value alt+ctrl+z
inside mycallback
function mycallback(){ // how name of clicked key i;e `alt+ctrl+z` here }
i want value
alt+ctrl+z
insidemycallback
since you're using jquery.hotkeys plugin, can access keys
property on data
object of event
object passed:
$(document).bind('keydown', 'alt+ctrl+z', mycallback); function mycallback(e) { console.log(e.data.keys); // alt+ctrl+z }
Comments
Post a Comment