From a8f44aa35d4a9735637e07b48a3b40654b3f0f65 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 22 Mar 2017 07:40:44 +0000 Subject: 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. --- lib/keyboard_utils.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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) -> -- cgit v1.2.3