Commit Graph
26 Commits
Author SHA1 Message Date
Michael Jumper a261bd2305 Key state object should be object, not Array. 2012-11-08 10:30:02 -08:00
Michael Jumper 21fb1e92bb Fix jsdoc, add missing documentation. 2012-08-11 12:52:30 -07:00
Michael Jumper d5e1b88cdc Use addEventListener(), only ignore key event if truly unknown (might have keyIdentifiier, but no keycode). 2012-08-02 00:53:22 -07:00
Michael Jumper 078322f808 Do not handle keypress if we already handled the event in keydown. 2012-07-27 13:21:45 -07:00
Michael Jumper 8f8b41fe8b Use timeout only as failsafe. Send key events immediately when we know we will handle via keypress or keydown. 2012-06-20 22:46:53 -07:00
Michael Jumper 88e2a7d500 Renamed deferred handler. 2012-05-16 15:32:46 -07:00
Michael Jumper 6cc12e88f9 preventDefault() in keypress, too. 2012-05-16 13:38:28 -07:00
Michael Jumper a650a4a6ec As keydown/keypress are handled via deferred setTimeout(), so should keyup (otherwise, there's a race condition that keyup might happen before the deferred handling of keydown/keypress, and the key might be effectively stuck down or in a repeating state). 2012-05-16 13:36:28 -07:00
Michael Jumper aa7c38be32 Should be using clearTimeout(), not clearInterval() for timeout. 2012-05-16 10:40:06 -07:00
Michael Jumper 685f07ed75 Don't wait for keypress if keycode well defined. Define space via keycode (some browsers interpret "space" as scroll down). 2012-05-16 10:36:37 -07:00
Michael Jumper 0399689177 Ignore unknown key events. 2012-05-16 00:52:16 -07:00
Michael Jumper 49fa2723a9 Only send release for ctrl+alt when both are pressed (we assume Ctrl+Alt == AltGr in the context of keypress). 2012-05-14 13:54:44 -07:00
Michael Jumper b8ad66ab6e Only release ctrl/alt in keypress handler if character is not a control character. Beware that this causes a regression in Firefox as it sends keypress for Alt+combinations and Ctrl+combinations even though they will not type anything. 2012-05-14 13:44:17 -07:00
Michael Jumper d3f5d003ea Only cancel keydown if not typable. Release Ctrl and Alt if actually typing a character via keypress (if they are not functioning as Ctrl or Alt). Cancel keydown if Ctrl or Alt (but not both) are held, even if we expect the character to be typable. 2012-05-14 13:21:43 -07:00
Michael Jumper 0abc6b3562 Add keyidentifier map. 2012-05-14 10:15:43 -07:00
Michael Jumper d6b1985396 Defer handling of keypress via JS event queue. 2012-05-14 09:17:15 -07:00
Michael Jumper b0196b89f1 Partial cleanup, track and expose key and modifier states. 2012-03-29 23:11:13 -07:00
Michael Jumper 8c7b883d55 Fixed regression with key repeat. 2012-03-29 17:42:34 -07:00
Michael Jumper eca34b24fb Allow user of API to decide whether keyboard events are canceled. 2012-03-29 10:05:38 -07:00
Michael Jumper 935088d9d4 Relicensed as Mozilla/LGPL/GPL. 2011-12-04 17:15:18 -08:00
Michael Jumper a4d810969d Cleanup, JSDoc for keyboard events. 2011-07-08 09:16:52 -07:00
Michael Jumper 5ea2be369c Some JSDoc for keyboard, cleaned up keymap. 2011-07-07 23:48:32 -07:00
Michael Jumper 3e65c46204 JSDoc + namespace, some cleanup. 2011-07-05 22:13:45 -07:00
Michael Jumper bd477daa2c More migration to traditional JS events. 2011-07-05 10:16:03 -07:00
Michael Jumper fbce63ea64 Removed keymap (merged into keyboard), fixed JS semicolons, etc. 2011-07-03 15:32:06 -07:00
Michael Jumper 098a521a4b Initial commit 2011-01-22 22:08:14 -08:00