BUG @ event.metaKey and event.ctrlKey
I came across this bug while trying to add support for meta key in my
jquery.hotkeys plugin (http://code.google.com/p/js-hotkeys)
Here is what I found at jquery.js | version 1.2.6 | line 2150
// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for
Macs)
if ( !event.metaKey && event.ctrlKey )
event.metaKey = event.ctrlKey;
This is causing a buggy behavior in the following scenario:
A user wish to bind ctrl+x to function-A and command+x to function-B
When ctrl+x were pressed, event.metaKey is true as well as
event.ctrlKey so function-B is called even though only function-A
should be triggered.
The the would obviously be to add additional check for Mac or non Mac
operating system, something like:
if ( !event.metaKey && event.ctrlKey && !(/Mac
OS/.test(navigator.userAgent))
event.metaKey = event.ctrlKey;