Skip to content

Commit

Permalink
Add support for minus (subtract) sign with 189 keycode which is repor…
Browse files Browse the repository at this point in the history
…ted by browsers on Mac OS X (tested in 10.10). Closes keithamus#59
  • Loading branch information
okonet committed Jan 6, 2015
1 parent 63b4cd8 commit 3b326bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions jwerty.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -183,7 +186,6 @@
// Comma, or ,
',': 188,
comma: 188,
//'-': 189, //???
// Period, or ., or full-stop
'.': 190,
period: 190,
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -537,4 +539,4 @@
KEYS: _keys
};

}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this)));
}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this)));

0 comments on commit 3b326bc

Please sign in to comment.