aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Blott2017-11-05 11:17:58 +0000
committerGitHub2017-11-05 11:17:58 +0000
commit291e5c4f37c6ce979b8739f0ccbfd12cc8a63115 (patch)
tree1f87e69c061f235343f791e007b30cba3ae74296 /lib
parent1eceb1413b43b0b43f225a5270dc9f2e6c212836 (diff)
parent87f017e48aa04ecc44dc06c1e4c35ffc5ecf611f (diff)
downloadvimium-291e5c4f37c6ce979b8739f0ccbfd12cc8a63115.tar.bz2
Merge pull request #2772 from smblott-github/enable-more-keys-v2
Add more named keys (version 2)
Diffstat (limited to 'lib')
-rw-r--r--lib/keyboard_utils.coffee8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 681ee139..8cd2a490 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -5,7 +5,7 @@ Utils?.monitorChromeStorage "mapKeyRegistry", (value) => mapKeyRegistry = value
KeyboardUtils =
# This maps event.key key names to Vimium key names.
keyNames:
- "ArrowLeft": "left", "ArrowUp": "up", "ArrowRight": "right", "ArrowDown": "down", " ": "space", "Backspace": "backspace"
+ "ArrowLeft": "left", "ArrowUp": "up", "ArrowRight": "right", "ArrowDown": "down", " ": "space"
init: ->
if (navigator.userAgent.indexOf("Mac") != -1)
@@ -38,10 +38,8 @@ KeyboardUtils =
""
else if key.length == 1
key
- else if key.length == 2 and "F1" <= key <= "F9"
- key.toLowerCase() # F1 to F9.
- else if key.length == 3 and "F10" <= key <= "F12"
- key.toLowerCase() # F10 to F12.
+ else if 1 < key.length
+ key.toLowerCase()
else
""