I am writing a script where I need to know if a user has pressed ctrl+s or ctrl+p. How do I do this. Help would be appreciated. the problem is as soon as the user presses ctrl+s the page doesn't go to script, it directly gets saved.
Asked
Active
Viewed 2,889 times
-2
-
3take a look at: http://stackoverflow.com/questions/93695/best-cross-browser-method-to-capture-ctrls-with-jquery – vikasing Feb 24 '13 at 07:02
-
I suggest to check [this](http://stackoverflow.com/questions/14860759/cant-override-ctrls-in-firefox-using-jquery-hotkeys) (btw, maybe your question is a duplicate). – lxgreen Feb 24 '13 at 07:18
2 Answers
0
You have to write a script that listens to and cancels the onkeydown event so the browser doesn't do the default behavior. Or maybe use a script like this? http://www.stepanreznikov.com/js-shortcuts/

Adam Brill
- 330
- 1
- 5
-
well guys , it worked and here is the code. include www.openjs.com/scripts/events/keyboard_shortcuts/shortcut.js and save it in the same folder as you html code – user2039532 Feb 24 '13 at 07:52