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 inside mycallback

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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -