pecial Keys | ||||||
Key | ASCII | Mozilla keycodes | IE keycodes | Opera keycodes | pseudo ASCII codes | exceptions |
---|---|---|---|---|---|---|
Insert | - | 45 | 45 | 45 | 45 | Konqueror: 0 Opera < 9.0: 0 |
Delete | - | 46 | 46 | 46 | 46 | Konqueror: 127 Opera < 9.0: 0 |
Home | - | 36 | 36 | 36 | 36 | Opera < 9.0: 0 |
End | - | 35 | 35 | 35 | 35 | Opera < 9.0: 0 |
Page Up | - | 33 | 33 | 33 | 33 | |
Page Down | - | 34 | 34 | 34 | 34 | |
Function Keys F1 to F12 | - | 112 to 123 | 112 to 123 | 112 to 123 | 112 to 123 | |
Keypad Keys |
Some browsers avoid this problem by not generating keypress events for special keys. A good case can be made that this is the right thing to do, since these keystrokes are arguably not character events. But such arguments are weakened by the arbitrariness of the division between normal and special keys. Why should the keyboard Backspace key have a keypress event, but not the keypad Delete key? Is Tab really fundamentally different than right arrow?
keypress events event.keyCode event.which event.charCode Internet Explorer (Windows) normal: ASCII code undefined undefined special: no keypress events for special keys Internet Explorer (Mac) normal: ASCII code undefined ASCII code special: no keypress events for special keys Gecko normal: zero ASCII code ASCII code special: Mozilla keycode zero zero WebKit ≥ 525 normal: ASCII code ASCII code ASCII code special: no keypress events for special keys WebKit < 525 normal: ASCII code ASCII code ASCII code special: extended ASCII code extended ASCII code extended ASCII code Opera ≥ 10.50 (all platforms) normal: ASCII code ASCII code undefined special: Mozilla keycode, except keypad and branded keys give Opera keycodes zero undefined Opera ≥ 9.50 (all platforms)
Opera 7 (Windows)normal: ASCII code ASCII code undefined special: Mozilla keycode, except keypad and branded keys give Opera keycodes zero for arrows, function keys, PageUp, PageDown
same as event.keyCode otherwiseundefined Opera 8.0 to 9.27 (Windows) normal: ASCII code ASCII code undefined special: Opera keycode zero for arrows, function keys, PageUp and PageDown,
same as event.keyCode otherwiseundefined Opera < 9.50 (Linux & Macintosh) normal: ASCII code ASCII code undefined special: Opera keycode zero for arrows, function keys, PageUp and PageDown,
same as event.keyCode otherwiseundefined Konqueror 4.3 normal: ASCII code ASCII code ASCII code special: Pseudo-ASCII code Pseudo-ASCII code zero Konqueror 3.5 normal: ASCII code ASCII code ASCII code special: Pseudo-ASCII code zero zero Konqueror 3.2 normal: ASCII code ASCII code undefined special: no keypress events for special keys
No comments:
Post a Comment