mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-26 17:05:47 +01:00
On Mac OS/X, control characters 27 through 31 pass charCode=CONTROL_CHAR
rather than charCode=KEY. For example, when a user wants <C-[>
Vimperator sees <C-Esc>. Most people view this as a bug in FirefOS/X.
The following patch tests for has("MacUnix"), then checks to see if the
control character is within this buggy range. If so, it shifts the
charCode up by 64 (there is a special case for Escape where the CTRL key
is relaxed and key is set to "Esc").
For more information, see:
[*] Vimp FAQ: http://vimperator.org/trac/wiki/Vimperator/FAQ#WhydoesntC-workforEscMacOSX
[*] Referenced mailing list msg: http://www.mozdev.org/pipermail/vimperator/2008-May/001548.html
[*] Mozilla bug 416227: event.charCode in keypress handler has unexpected values on Mac for Ctrl with chars in "[ ] _ \"
https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=416227
[*] Mozilla bug 432951: Ctrl+'foo' doesn't seem same charCode as Meta+'foo' on Cocoa
https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=432951
66 KiB
66 KiB