Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Add support for minus (subtract) sign with 189 keycode #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)));