3 ms·
Does it work only in Chrome, or something? Noting happens for me in Firefox. Edit: got blocked by AdBlock+. Remark: it ignores characters/keys that aren't pre
by wazoox 15y ago
Does it work only in Chrome, or something? Noting happens for me in Firefox.
Edit: got blocked by AdBlock+.
Remark: it ignores characters/keys that aren't present on US keyboards. No é è à ñ ö π ς φ ... would it be possible to catch Alt/Shift keys, for instance?
- warp 15y agoWorks for me in Firefox (Firefox 5.0, Ubuntu).
- pa7 15y agoapparently adblock+ blocks js files called "heatmap"
- shabble 15y agoShifted keys, or at least upper-case letters should be easily handled. The problem I suspect is deciding which shift key has been used (or whether caps lock is enabled). As far as other modifiers, I think a lot of those aren't available to the keypress handler (Specifically, things like cmd-* on a Mac are usually handled by the windowmanager or as app menu shortcuts). I think I have seen html5/js demos that capture more than the usual set of keystrokes though (emacs & vim js demos spring to mind), so it might be possible to do so. As far as special characters, that'd require you to detect the user keyboard layout in order to know where the appropriate key lives (with added effort for dead-key style modification) Edit: poking around in the http://www.ymacs.org/ http://www.ymacs.org/ source, there's a reference to http://unixpapa.com/js/key.html http://unixpapa.com/js/key.html which gives access to a whole bunch of extra keycodes.