This commit is contained in:
2014-08-13 12:48:04 +04:00
parent a484fa6fba
commit 99d0547fd1

View File

@@ -44,9 +44,13 @@ class InputTextField extends TextField {
untyped __js__("window.event.preventDefault()");
switch (event.keyCode) {
case Keyboard.BACKSPACE:
text = text.substring(0, text.length - 1);
text = event.ctrlKey ? "" : text.substring(0, text.length - 1);
case x if (x >= 65 && x <= 90):
text += String.fromCharCode(event.keyCode + (event.shiftKey ? 0 : 32));
case x if (x >= 48 && x <= 57):
text += String.fromCharCode(event.keyCode);
case x if (x >= 96 && x <= 105):
text += String.fromCharCode(event.keyCode - 48);
}
}