diff options
| author | Conrad Irwin | 2010-05-29 03:28:36 +0100 |
|---|---|---|
| committer | Phil Crosby | 2010-06-01 21:55:48 -0700 |
| commit | 9d0061dca6101926da760e159d50151984ae24f8 (patch) | |
| tree | 4405a8015e4526e68b98886c0c3f99fc16ec1d7d /background_page.html | |
| parent | 3b412ce951643214f5e0f943e10ff9302fe001b9 (diff) | |
| download | vimium-9d0061dca6101926da760e159d50151984ae24f8.tar.bz2 | |
Allow mapping to arrow keys and f-keys
Conflicts:
commands.js
Diffstat (limited to 'background_page.html')
| -rw-r--r-- | background_page.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/background_page.html b/background_page.html index e85dd7d6..9e43fecd 100644 --- a/background_page.html +++ b/background_page.html @@ -15,7 +15,7 @@ var validFirstKeys = {}; var singleKeyCommands = []; - var hasModifierRegex = /^<[amc]-.>/; + var namedKeyRegex = /^(<[amc-].|(?:[amc]-)?[a-z]{2,5}>)(.*)$/; var defaultSettings = { scrollStepSize: 60, @@ -407,15 +407,15 @@ } function splitKeyIntoFirstAndSecond(key) { - if (key.search(hasModifierRegex) == 0) - return { first: key.slice(0, 5), second: key.slice(5) }; + if (key.search(namedKeyRegex) == 0) + return { first: RegExp.$1, second: RegExp.$2 }; else return { first: key[0], second: key.slice(1) }; } function getActualKeyStrokeLength(key) { - if (key.search(hasModifierRegex) == 0) - return 1 + getActualKeyStrokeLength(key.slice(5)); + if (key.search(namedKeyRegex) == 0) + return 1 + getActualKeyStrokeLength(RegExp.$2); else return key.length; } |
