Permalink
Browse files

Fix event.key for keypress. It doesn't need to lookup keynames with k…

…eypress and shift

mootools/mootools-more#1194
1 parent 3ad6cd0 commit 1781fa014d2e6b4eb089210d8710f7e13f9b297f @arian arian committed Apr 18, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 Source/Types/DOMEvent.js
@@ -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;

0 comments on commit 1781fa0

Please sign in to comment.