diff options
| -rw-r--r-- | background_page.html | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/background_page.html b/background_page.html index 11788dc6..4c075899 100644 --- a/background_page.html +++ b/background_page.html @@ -11,7 +11,7 @@ var validFirstKeys = {}; var singleKeyCommands = []; - var specialKeyStrokeRegex = /^<(a|m|c)-.>/; + var hasModifierRegex = /^<[amc]-.>/; var defaultSettings = { scrollStepSize: 60, @@ -338,14 +338,14 @@ // End action functions function splitKeyIntoFirstAndSecond(key) { - if (key.search(specialKeyStrokeRegex) == 0) + if (key.search(hasModifierRegex) == 0) return { first: key.slice(0, 5), second: key.slice(5) }; else return { first: key[0], second: key.slice(1) }; } function getActualKeyStrokeLength(key) { - if (key.search(specialKeyStrokeRegex) == 0) + if (key.search(hasModifierRegex) == 0) return 1 + getActualKeyStrokeLength(key.slice(5)); else return key.length; @@ -355,9 +355,7 @@ for (var key in keyToCommandRegistry) { if (getActualKeyStrokeLength(key) == 2) - { validFirstKeys[splitKeyIntoFirstAndSecond(key).first] = true; - } } } |
