AnitaTang / js-hotkeys

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

Function called on ALL keypress #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Added $(document).bind('keypress', 'Ctrl+s', fn);
2. Create function fn with single line alert('search');

What is the expected output? What do you see instead?
Expected to see only alert prompt on pressing ctrl + s, however it seems to
trigger the function on any keypress.

What version of the product are you using? On what operating system?
0.7.9.min on linux server 

Please provide any additional information below.
The error does not seems to occur on my development station (windows 7)

Original issue reported on code.google.com by jsne...@gmail.com on 4 Feb 2010 at 3:55

GoogleCodeExporter commented 8 years ago
The same for me in windows vista and firefox. Any keypress... 

Original comment by jos...@gmail.com on 22 Mar 2010 at 11:07

GoogleCodeExporter commented 8 years ago
This is happening because the hotkeys plugin is not being included, thus, your 
call fallbacks to jQuery's original bind, which binds the fn function to the 
keypress event. That's why it's fired on every key press.

Original comment by andreipi...@google.com on 14 Jul 2011 at 10:34