Firefox return key
Keycode (keypress) function key (shift, Ctrl, ALT, printscreen, scrolllock no return value) returns the correct value, all other key values are 0
Keycode (keydown) returns all the key values except printscreen. The primary key displays the key value (65-90) in the uppercase/lowercase state)
Keycode (keyup) returns all key values except printscreen. The primary key displays the key value in the uppercase/lowercase state (65-90)
Charcode (keypress) returns the character key (65-90, 97-122), shift, Ctrl, ALT, printscreen, scrolllock, and no return value. All other key values are 0.
Charcode (keydown) all key values are 0
Charcode (keyup) all key values are 0
Keycode (keypress) returns the correct values of all character keys (case-sensitive 65-90, 97-122)
Keycode (keydown) returns all the key values except printscreen. The primary key displays the key value (65-90) in the uppercase/lowercase state)
Keycode (keyup) returns all key values except printscreen. The primary key displays the key value in the uppercase/lowercase state (65-90)
Charcodeie does not support this attribute
Test keycode, charcode value, ff, and IE always get unexpected results. It was completely irregular, and later we found that different events would lead to different results. As shown in the preceding table, keycode and charcode returned by different browsers and Keyboard Events (charcode is not supported by IE) are not tested. Safari and opera are not tested ~ ····
Original article address:
Omiga.org/blog/archives/50