aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdh19952016-09-17 15:27:39 +0800
committergdh19952016-09-17 15:27:39 +0800
commit36afaafc98708a8c0f3915e0c494fcc94bf65b3e (patch)
tree2e76e11534ba2dd90e34fd967f36fea65c956ffc
parent3a7a1ab035181ab1346181d8bdda5db5038b9c89 (diff)
downloadvimium-36afaafc98708a8c0f3915e0c494fcc94bf65b3e.tar.bz2
use keyNames to check backspace keyCode
-rw-r--r--lib/keyboard_utils.coffee4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index c5dbd69a..4f8336c7 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -4,7 +4,7 @@ KeyboardUtils =
f12: 123, tab: 9, downArrow: 40, upArrow: 38 }
keyNames:
- { 37: "left", 38: "up", 39: "right", 40: "down", 32: "space" }
+ { 37: "left", 38: "up", 39: "right", 40: "down", 32: "space", 8: "backspace" }
# This is a mapping of the incorrect keyIdentifiers generated by Webkit on Windows during keydown events to
# the correct identifiers, which are correctly generated on Mac. We require this mapping to properly handle
@@ -49,8 +49,6 @@ KeyboardUtils =
event.key.toLowerCase() # F1 to F9.
else if event.key.length == 3 and "F10" <= event.key <= "F12"
event.key.toLowerCase() # F10 to F12.
- else if event.key == "Backspace"
- event.key.toLowerCase() # Backspace.
else
""