Subject: | Make keypresses handling more cross-browser |
Shortcuts handling in debugger.js is based on the value of keyCode property in the fired event. However, this is known to not work in some browsers (e.g. in Firefox 24 it is always =0 and one should use charCode instead).
jQuery wraps those incompatibilities and adds "which" property that contains the keyCode|cahrCode|anythingelse related to the key being pressed:
Show quoted text
To determine which character was entered, examine the event object that is passed to the handler function. While browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve the character code. <<<
To determine which character was entered, examine the event object that is passed to the handler function. While browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve the character code. <<<