aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormrmr19932017-11-11 15:23:18 +0000
committermrmr19932017-11-11 15:23:18 +0000
commit2bb2d314f13368e125018932aec4e7d80f5f2cfb (patch)
tree0acff50d1283c792a5cc21e6bef57748033784f3 /lib
parent7cb53750bfb5f62849fcfb52f67b1e04ad0f9672 (diff)
downloadvimium-2bb2d314f13368e125018932aec4e7d80f5f2cfb.tar.bz2
Don't resolve modifiers as keys
Diffstat (limited to 'lib')
-rw-r--r--lib/keyboard_utils.coffee5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 70aa5a95..09623e50 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -36,6 +36,8 @@ KeyboardUtils =
""
else if key of @keyNames
@keyNames[key]
+ else if @isModifier event
+ "" # Don't resolve modifier keys.
else if key.length == 1
key
else
@@ -70,6 +72,9 @@ KeyboardUtils =
isPrintable: (event) ->
@getKeyCharString(event)?.length == 1
+ isModifier: (event) ->
+ event.key in ["Control", "Shift", "Alt", "OS", "AltGraph", "Meta"]
+
enUsTranslations:
"Backquote": ["`", "~"]
"Minus": ["-", "_"]