aboutsummaryrefslogtreecommitdiffstats
path: root/lib/keyboard_utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2017-09-01 16:48:35 +0100
committerStephen Blott2017-09-01 16:48:35 +0100
commit1358fff3981cab5d8e0aa273cca2378aca2d766c (patch)
tree47cc4e2d96615e6bc8205d382ef4a1875b432adf /lib/keyboard_utils.coffee
parentbbad2739341c59e4b1eb413dd52a4cf7b9159fd8 (diff)
downloadvimium-1358fff3981cab5d8e0aa273cca2378aca2d766c.tar.bz2
Handle shifted numeric keys.
Diffstat (limited to 'lib/keyboard_utils.coffee')
-rw-r--r--lib/keyboard_utils.coffee11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 471e18c9..4b03aeed 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -23,7 +23,6 @@ KeyboardUtils =
key = event.code
# Strip some standard prefixes.
key = key[3..] if key[...3] == "Key"
- key = key[5..] if key[...5] == "Digit"
key = key[6..] if key[...6] == "Numpad"
# Translate some special keys to event.key-like strings.
if @enUsTranslations[key]
@@ -83,6 +82,16 @@ KeyboardUtils =
"Period": [".", ">"]
"Slash": ["/", "?"]
"Space": [" ", " "]
+ "Digit1": ["1", "!"]
+ "Digit2": ["2", "@"]
+ "Digit3": ["3", "#"]
+ "Digit4": ["4", "$"]
+ "Digit5": ["5", "%"]
+ "Digit6": ["6", "^"]
+ "Digit7": ["7", "&"]
+ "Digit8": ["8", "*"]
+ "Digit9": ["9", "("]
+ "Digit0": ["0", ")"]
KeyboardUtils.init()