Live data from Hacker News

Keymaster.js: painless keyboard shortcuts for javascript

github.com

21–23 of 23 posts

Re: Keymaster.js: painless keyboard shortcuts for javascript

#23

Hmm. Binds all events to `document`, which means that if you type something in a text field, it'll still trigger the event. (One of the TODOs is "Make behavior with INPUT / SELECT / TEXTAREA configurable.) Thing is, jQuery Hotkeys ( https://github.com/jeresig/jquery.hotkeys ) is more versatile (since you can bind events to any element), works under a wider range of browsers, and is nearly as lightweight (if you alrea…

In case anyone wants it, here's my unicode-friendly fork of jQuery Hotkeys: https://github.com/TrevorBurnham/jquery.hotkeys

Note that because of the way the library works, you can only use the unicode equivalents on this fork—aliases like "ctrl" and "alt" will not work. (jQuery Hotkeys was written with a pretty hardcore approach to efficiency, so everything is 1:1. Keymaster uses an `indexOf` search each time a key is pressed, which has a negligible impact on performance in modern browsers.)

Post reply on HN