refactor
This commit is contained in:
parent
a56f52c765
commit
ccffa3a61f
@ -867,7 +867,7 @@
|
||||
return e.preventDefault();
|
||||
},
|
||||
keyCode: function(e) {
|
||||
var kc;
|
||||
var c, kc;
|
||||
key = (function() {
|
||||
switch (kc = e.keyCode) {
|
||||
case 8:
|
||||
@ -892,6 +892,7 @@
|
||||
case 55:
|
||||
case 56:
|
||||
case 57:
|
||||
return String.fromCharCode(kc);
|
||||
case 65:
|
||||
case 66:
|
||||
case 67:
|
||||
@ -918,10 +919,9 @@
|
||||
case 88:
|
||||
case 89:
|
||||
case 90:
|
||||
c = String.fromCharCode(kc);
|
||||
if (e.shiftKey) {
|
||||
return String.fromCharCode(kc);
|
||||
} else {
|
||||
return String.fromCharCode(kc).toLowerCase();
|
||||
return c.toLowerCase();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -632,11 +632,11 @@ keybinds =
|
||||
'Right'
|
||||
when 40
|
||||
'Down'
|
||||
when 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 #0-9 and A-Z
|
||||
if e.shiftKey
|
||||
String.fromCharCode kc
|
||||
else
|
||||
String.fromCharCode(kc).toLowerCase()
|
||||
when 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 #0-9
|
||||
String.fromCharCode kc
|
||||
when 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 #A-Z
|
||||
c = String.fromCharCode kc
|
||||
c.toLowerCase() if e.shiftKey
|
||||
else
|
||||
null
|
||||
if key
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user