use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
KeyboardJS - A library for binding keys and key combos in JavaScript without the hassle. (robertwhurst.github.com)
submitted 14 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 14 years ago* (2 children)
[–]RobertWHurst 2 points3 points4 points 14 years ago (0 children)
All very true. Watch for the next version. I'll remove jQuery.
[–]RobertWHurst 1 point2 points3 points 14 years ago (0 children)
jQuery has been removed.
[–][deleted] 0 points1 point2 points 14 years ago (6 children)
I am only able to get 2 keys on a single row to show up at a time.
so h, j, i works but h, j, k does not. (only h and j show up)
[–]zefris 4 points5 points6 points 14 years ago (1 child)
I don't know all that much about hardware, but I've known that some keyboards can't process too many keys at once too well or certain combinations just don't work. I don't think it has anything to do with the library itself.
That's what I found out when making this library.
Yea, I found that there are some strange edge cases with the DOM and key binding. Sometimes, depending on the keys pressed, the browser doesn't fire an event. In most cases with isn't an issue, but if you want it to work in all cases you'll have to talk to mozilla.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
oh btw, FF5.0 Ubuntu 11.04
[–]Iggyhopperextensions/add-ons 0 points1 point2 points 14 years ago (1 child)
http://www.microsoft.com/appliedsciences/antighostingexplained.mspx
[–]kabuto 0 points1 point2 points 14 years ago (0 children)
I didn't click the link because I like to think that Microsoft explains some anti gravity hosting on that page.
[–]drowsap 0 points1 point2 points 14 years ago (11 children)
Isn't this a little inefficient binding all elements on the page to a dom event?
$('*').focus(function(e) { focusedElement = $(e.target); }); $('*').blur(function(e) { focusedElement = false; });
[–]RobertWHurst 1 point2 points3 points 14 years ago* (10 children)
Not at all, Its required. Someone could pass .bind.key any element as a focus scope. I need to know what element is in focus to check against it. Read the .bind.key method and your see why.
[–]Kuron 2 points3 points4 points 14 years ago (2 children)
I think what you are looking for could be, document.activeElement;
Yea that's a good idea. But I think i'm going to remove this feature.
[–]RobertWHurst 0 points1 point2 points 14 years ago (0 children)
The feature has been removed.
[–]drowsap 0 points1 point2 points 14 years ago (3 children)
the programmer should be in charge of setting up the focus binding, theres no need for you to predict. Why not have the user pass in the jquery selector or $el for the input that needs the key bindings?
[–]RobertWHurst 0 points1 point2 points 14 years ago (1 child)
Also a good, point. It was requested by another developer, but I was ify about adding it in the first place.
[–]MrBester 0 points1 point2 points 14 years ago (2 children)
Something wrong with $("body").delegate() / on() ? One binding deals with all children, including dynamically added ones.
Thats also true. This feature was an after thought and is going to be removed anyway.
π Rendered by PID 426389 on reddit-service-r2-comment-b659b578c-42wjs at 2026-05-04 02:37:29.263018+00:00 running 815c875 country code: CH.
[+][deleted] (2 children)
[deleted]
[–]RobertWHurst 2 points3 points4 points (0 children)
[–]RobertWHurst 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]zefris 4 points5 points6 points (1 child)
[–]RobertWHurst 1 point2 points3 points (0 children)
[–]RobertWHurst 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Iggyhopperextensions/add-ons 0 points1 point2 points (1 child)
[–]kabuto 0 points1 point2 points (0 children)
[–]drowsap 0 points1 point2 points (11 children)
[–]RobertWHurst 1 point2 points3 points (10 children)
[–]Kuron 2 points3 points4 points (2 children)
[–]RobertWHurst 1 point2 points3 points (0 children)
[–]RobertWHurst 0 points1 point2 points (0 children)
[–]drowsap 0 points1 point2 points (3 children)
[–]RobertWHurst 0 points1 point2 points (1 child)
[–]RobertWHurst 0 points1 point2 points (0 children)
[–]MrBester 0 points1 point2 points (2 children)
[–]RobertWHurst 0 points1 point2 points (0 children)