2

I have not used jquery.hotkeys.js in a while, but I cant seem to get even the most basic test to work in any current browsers.

Using Ver 0.8 I also tried with other versions of jQuery but stuck with 1.4.2 for testing since that was what John Resig had in his examples.

<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="/js/jquery.hotkeys.js"></script> <script> jQuery(document).ready(function(){ $(document).bind('keydown', "f", function() { alert("click"); return false; }); }); </script> </head> <body> 

1

1 Answer 1

1

I don't know about the bind aspect, but this seems to work for me

 $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi, you just pressed ctrl-z'); } }); 

full code here:

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function () { alert('1st'); }); $(document).keydown(function (event) { if (event.ctrlKey && event.keyCode == 90) { alert('hi, you just pressed ctrl-z'); } }); </script> </head> <body> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.