MapKey: jQuery for Keyboard shortcuts(pixelmatrixdesign.com)
pixelmatrixdesign.com
MapKey: jQuery for Keyboard shortcuts
http://pixelmatrixdesign.com/weblog/comments/introducing_mapkey/
6 comments
Straight from the github readme:
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
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
last time I looked hotkeys was tied to and old (<1.3) release of jquery too.
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
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
http://www.openjs.com/scripts/events/keyboard_shortcuts
shortcut.add("Up",function() {
// code to go up
});I created a similar plugin, but it uses a Vi-like binding schema.
https://github.com/paydro/keylock
https://github.com/paydro/keylock
I've been struggling with this for a little bit. I have a web application that I'm developing that needs to support keyboard shortcuts. It's basically a giant SVG element on the page with a toolbar at the top, and some popup windows. The problem seems to be always capturing the keys. As long as the user interacts with the SVG element, everything is fine. However, if they move their mouse over the navigation bar (for instance) absentmindedly, then press "Delete", there seems to be a good chance they will end up "going back" instead of me having a chance to see that keypress and intercept it.
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?
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?
I posted this as a question on SO as well: http://stackoverflow.com/questions/4959487/best-way-to-captu...
Just in case someone comes across this later on Google.
Just in case someone comes across this later on Google.
I'm not a javascript or jquery guru but from what I can tell it's still not possible to reliably grab all keyboard characters within a browser. Browsers will hijack many combinations - backspace key (some browsers change depending where your mouse is), alt+f, etc. And they're inconsistent in what they grab.
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.
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.
I think things are better than you think. I use keyboard shortcuts extensively on gmail and asana and neither of them feel compromised at all in that department.
https://github.com/jeresig/jquery.hotkeys