Skip to content

Commit

Permalink
Fix event.key for keypress. It doesn't need to lookup keynames with k…
Browse files Browse the repository at this point in the history
…eypress and shift

mootools/mootools-more#1194
  • Loading branch information
arian committed Feb 8, 2015
1 parent 3ad6cd0 commit 1781fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Types/DOMEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var DOMEvent = this.DOMEvent = new Type('DOMEvent', function(event, win){

if (type.indexOf('key') == 0){
var code = this.code = (event.which || event.keyCode);
this.key = _keys[code]/*<1.3compat>*/ || Object.keyOf(Event.Keys, code)/*</1.3compat>*/;
this.key = !this.shift && (_keys[code]/*<1.3compat>*/ || Object.keyOf(Event.Keys, code)/*</1.3compat>*/);
if (type == 'keydown' || type == 'keyup'){
if (code > 111 && code < 124) this.key = 'f' + (code - 111);
else if (code > 95 && code < 106) this.key = code - 96;
Expand Down

0 comments on commit 1781fa0

Please sign in to comment.