8 ms·
It doesn't do modifier key event generation correctly. On a US keyboard, hold down shift and 4 (i.e. type "$"). The second item highlights. Now release shift
by ajross 14y ago
It doesn't do modifier key event generation correctly. On a US keyboard, hold down shift and 4 (i.e. type "$"). The second item highlights. Now release shift. The first item highlights, incorrectly, because the library apparently generated a keydown event for "4" when the shift key was released. That's wrong by all standard conventions. Modifier key releases should never synthesize presses.
- deleted 14y ago[deleted]
- craigc 14y agoWhat browser are you using? It works correctly for me using Chrome on Mac. Could you make a ticket on Github?
- ajross 14y agoChrome 20 on linux. Bug submitted: https://github.com/ccampbell/mousetrap/issues/3 https://github.com/ccampbell/mousetrap/issues/3
- craigc 14y agoThank you.
- craigc 14y agoI wonder if this is related to https://github.com/ccampbell/mousetrap/issues/6 https://github.com/ccampbell/mousetrap/issues/6 In which case it should be a pretty painless fix.
- antoko 14y agosame issue on Win7 / FF13 Also affects the "* a" combo if you release shift before releasing 8 then release 8 and press "a" it doesn't recognize the combination (presumably because its reading a key press of 8 in between them)
- bederoso 14y agoI know it doesn't actually say that Opera is supported, but all highlights work, and that little bug he mentioned also occurs in Opera
- jabiko 14y agoI think there is no way to change this behavior: https://developer.mozilla.org/en/DOM/KeyboardEvent#Auto-repeat_on_some_GTK.C2.A0environments_such_as_Ubuntu_9.4 https://developer.mozilla.org/en/DOM/KeyboardEvent#Auto-repe...
- ajross 14y agoIt's a mess (the core problem is that the X server automatically generates release/press event pairs to implement key repeat which can't affirmatively be detected as "synthetic"). But it's handlable heuristically. The way I've seen it done it via a timeout on "release after a long press". If the key has been down for more than ~1 second, then hold off on interpreting a release event to see if there's a matching press already queued in the pipe or not. The timeout can be very short (the X server sends them both synchronously down the socket with no delay).