getModifierState is case sensitive

This commit is contained in:
Andreas Svensson 2014-07-18 18:24:11 +02:00
parent e85e5e9952
commit 495d866a66
1 changed files with 5 additions and 5 deletions

View File

@ -25,10 +25,10 @@
*/
var modifierKeyToProp = {
'alt': 'altKey',
'control': 'ctrlKey',
'meta': 'metaKey',
'shift': 'shiftKey'
'Alt': 'altKey',
'Control': 'ctrlKey',
'Meta': 'metaKey',
'Shift': 'shiftKey'
};
// IE8 does not implement getModifierState so we simply map it to the only
@ -41,7 +41,7 @@ function modifierStateGetter(keyArg) {
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg.toLowerCase()];
var keyProp = modifierKeyToProp[keyArg];
return keyProp && nativeEvent[keyProp];
}