
MapKey: jQuery for Keyboard shortcuts - kingsidharth
http://pixelmatrixdesign.com/weblog/comments/introducing_mapkey/
======
Pewpewarrows
This seems neat, but would there be any reason for using this over something
like jquery.hotkeys?

<https://github.com/jeresig/jquery.hotkeys>

~~~
abp
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_

------
LiveTheDream
<http://www.openjs.com/scripts/events/keyboard_shortcuts>

    
    
        shortcut.add("Up",function() {
            // code to go up
        });

------
paydro
I created a similar plugin, but it uses a Vi-like binding schema.

<https://github.com/paydro/keylock>

------
silverlight
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?

~~~
silverlight
I posted this as a question on SO as well:
[http://stackoverflow.com/questions/4959487/best-way-to-
captu...](http://stackoverflow.com/questions/4959487/best-way-to-capture-all-
key-events-for-a-web-application)

Just in case someone comes across this later on Google.

------
cturner
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.

~~~
famousactress
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.

