aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Blott2017-03-22 07:40:44 +0000
committerStephen Blott2017-03-22 07:40:47 +0000
commita8f44aa35d4a9735637e07b48a3b40654b3f0f65 (patch)
treec2a588c386231c67cecc7d5d1adca49e49e6332c /lib
parenta2d3b2042e540f0c4b065fffacdac01982053014 (diff)
downloadvimium-a8f44aa35d4a9735637e07b48a3b40654b3f0f65.tar.bz2
Remove and refactor mapKeyRegistery.
1. Remove the use of mapKeyRegistery from the mode handler. 2. Refactor use of mapKeyRegistery keyboard utils. This is preparatory to refactoring all of the keyboard handling.
Diffstat (limited to 'lib')
-rw-r--r--lib/keyboard_utils.coffee7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 22f37fb3..a4ddf47a 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -1,3 +1,7 @@
+mapKeyRegistry = {}
+# NOTE: "?" here for the tests.
+Utils?.monitorChromeStorage "mapKeyRegistry", (value) => mapKeyRegistry = value
+
KeyboardUtils =
keyCodes:
{ ESC: 27, backspace: 8, deleteKey: 46, enter: 13, ctrlEnter: 10, space: 32, shiftKey: 16, ctrlKey: 17, f1: 112,
@@ -83,9 +87,6 @@ KeyboardUtils =
isPrimaryModifierKey: (event) -> if (@platform == "Mac") then event.metaKey else event.ctrlKey
isEscape: do ->
- mapKeyRegistry = {}
- # NOTE: "?" here for the tests.
- Utils?.monitorChromeStorage "mapKeyRegistry", (value) => mapKeyRegistry = value
# TODO(smblott) Change this to use event.key.
(event) ->