diff --git a/include/keyboard.js b/include/keyboard.js index 623d5b293c96c51605e0987e65ee711812bb956d..f21f9767bb8fdece741135e41de9f6be64fd655a 100644 --- a/include/keyboard.js +++ b/include/keyboard.js @@ -31,7 +31,7 @@ var kbdUtil = (function() { function hasShortcutModifier(charModifier, currentModifiers) { var mods = {}; for (var key in currentModifiers) { - if (key !== 0xffe1) { + if (parseInt(key) !== 0xffe1) { mods[key] = currentModifiers[key]; } } diff --git a/tests/test.helper.js b/tests/test.helper.js index d6a68cd9ada271176237d62a1d4b12053f1f8a23..d9e8e14437ad44febd4bdd755287c1ba205e2637 100644 --- a/tests/test.helper.js +++ b/tests/test.helper.js @@ -248,5 +248,13 @@ describe('Helpers', function() { })).to.be.deep.equal([{keysym: keysyms.lookup(0xffe9), type: 'keydown'}]); }); }); + describe('do not treat shift as a modifier key', function() { + it('should not treat shift as a shortcut modifier', function() { + expect(kbdUtil.hasShortcutModifier([], {0xffe1 : true})).to.be.false; + }); + it('should not treat shift as a char modifier', function() { + expect(kbdUtil.hasCharModifier([], {0xffe1 : true})).to.be.false; + }); + }); }); });