aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-20 19:46:51 +0100
committerStephen Blott2015-05-20 19:47:12 +0100
commit81a22885c14b3cb12dc11484b01a689f1e0c2e46 (patch)
tree5e97774896e2ed8d59c2bcd59a8d3f73f12cf2ea
parent0ac2cf831592d08c7cd42b6f0ea6bfae6fb926b6 (diff)
downloadvimium-81a22885c14b3cb12dc11484b01a689f1e0c2e46.tar.bz2
Allowing mapping <space>.
Fixes #544. Copy of #655.
-rw-r--r--README.md1
-rw-r--r--background_scripts/commands.coffee1
2 files changed, 2 insertions, 0 deletions
diff --git a/README.md b/README.md
index c391c08e..023605f4 100644
--- a/README.md
+++ b/README.md
@@ -127,6 +127,7 @@ The following special keys are available for mapping:
- `<c-*>`, `<a-*>`, `<m-*>` for ctrl, alt, and meta (command on Mac) respectively with any key. Replace `*`
with the key of choice.
- `<left>`, `<right>`, `<up>`, `<down>` for the arrow keys
+- `<space>` for the space key
- `<f1>` through `<f12>` for the function keys
Shifts are automatically detected so, for example, `<c-&>` corresponds to ctrl+shift+7 on an English keyboard.
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index bca1c3a4..708fe5d5 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -52,6 +52,7 @@ Commands =
key.replace(/<[acm]-/ig, (match) -> match.toLowerCase())
.replace(/<([acm]-)?([a-zA-Z0-9]{2,5})>/g, (match, optionalPrefix, keyName) ->
"<" + (if optionalPrefix then optionalPrefix else "") + keyName.toLowerCase() + ">")
+ .replace /<space>/ig, " "
parseCustomKeyMappings: (customKeyMappings) ->
lines = customKeyMappings.split("\n")