MapKey: jQuery for Keyboard shortcuts
pixelmatrixdesign.com
pixelmatrixdesign.com
More advanced stuff
This plugin is meant to be a very light one. If you need to do more advanced things, I suggest trying jeresig’s plugin jQuery.hotkeys. That can handle things like key combinations and more
EDIT: I was wrong. Rewritten in Jan this year to work with 1.4.2, which is really good news. https://github.com/jeresig/jquery.hotkeys
shortcut.add("Up",function() {
// code to go up
});Is there any reliable way that works in modern browsers (Firefox, Chrome, Safari) of capturing all the key events on a page, outside of using something like jquery.hotkeys and just doing:
$(document).bind("keyup", "delete", function() { });
Is $(window) better? Some other element I'm not thinking of?
Just in case someone comes across this later on Google.
For this reason, I'd still far prefer console applications rather than a browser, despite the rendering advantages you get with a browser.
With a console app, you can easily get to a point where it will always work the same, regardless of the platform your user is on.
Keyboard interaction should be a more important part of desktop computer usage than it is in these modern wimpy systems we use. The state of the browser is the main driver of this.