maheshchari / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

binded function works only for whole keyboard #80

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I've included the js and bound the following function to key "tab". In fact 
it does not matter if I press tab or any other keys...the code within the 
function is always triggered when I press a key. Can't be, right?

$(document).bind('keydown', 'tab', function() {
    alert('You pressed tab!');
});

I am using jQuery 1.4.2, hotkeys 0.7.9, IE 8, Windows 7.

If you got any ideas why this behaviour occurs, please let me know.

Kind regards,
Patrick

Original issue reported on code.google.com by patrick....@gmail.com on 29 Mar 2010 at 9:15

GoogleCodeExporter commented 8 years ago
there were tones of changes made for jquery 1.4.2 by John Resig.
You may pull them from github. I believe it will solve all your problems. 

Original comment by Afro.Sys...@gmail.com on 29 Mar 2010 at 10:56

GoogleCodeExporter commented 8 years ago
Thank you for this information. I did not know that there is a second hotkey 
code 
development website. I've downloaded his version of jquery.hotkeys.js, but 
unfortunately, it does not work out of the box. Maybe his version of jQuery 
1.4.2 will 
solve the problem, but I don't think I will use it, because I intend to use 
only the 
original build from jquery.com.

Are there any reported sideeffects? I will check the log, which changes he made 
to the 
library.

Original comment by patrick....@gmail.com on 30 Mar 2010 at 6:56