From 3b326bc8fc82e9ecd59319fffa2e67d4b1f4bff5 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Tue, 6 Jan 2015 18:38:08 +0100 Subject: [PATCH] Add support for minus (subtract) sign with 189 keycode which is reported by browsers on Mac OS X (tested in 10.10). Closes #59 --- jwerty.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jwerty.js b/jwerty.js index 8107bbf..73ca681 100644 --- a/jwerty.js +++ b/jwerty.js @@ -169,6 +169,9 @@ // Num-Subtract, or - '-': 109, subtract: 109, + // Num-Subtract, or - on Mac OS X + '-': 189, + subtract: 189, 'num-.': 110, 'num-period': 110, 'num-dot': 110, @@ -183,7 +186,6 @@ // Comma, or , ',': 188, comma: 188, - //'-': 189, //??? // Period, or ., or full-stop '.': 190, period: 190, @@ -501,10 +503,10 @@ var element = realTypeOf(realSelector, 'element') ? realSelector : $$(realSelector, realSelectorContext); var callback = jwerty.event(jwertyCode, callbackFunction, realcallbackContext); $b( element, callback ); - + return {unbind:function(){ $u( element, callback ) }}; }, - + /** * jwerty.fire * @@ -537,4 +539,4 @@ KEYS: _keys }; -}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this))); \ No newline at end of file +}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this)));