From cae39ee44074a4adc279f593f6891a1ff0b53bef Mon Sep 17 00:00:00 2001 From: Daniel Lo Nigro Date: Sun, 14 Sep 2014 21:26:55 -0700 Subject: [PATCH 1/2] Add some missing keys to getEventKey --- src/browser/ui/dom/getEventKey.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/ui/dom/getEventKey.js b/src/browser/ui/dom/getEventKey.js index fafa315601e..f1fd3d7ff25 100644 --- a/src/browser/ui/dom/getEventKey.js +++ b/src/browser/ui/dom/getEventKey.js @@ -67,8 +67,12 @@ var translateToKey = { 40: 'ArrowDown', 45: 'Insert', 46: 'Delete', + 91: 'Meta', // Left Command on Mac + 93: 'Meta', // Right Command on Mac 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6', 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12', + 124: 'F13', 125: 'F14', 126: 'F15', 127: 'F16', 128: 'F17', 129: 'F18', + 130: 'F19', 144: 'NumLock', 145: 'ScrollLock', 224: 'Meta' From d5753d7e245e5eeafc178cbd25584740b2e26e30 Mon Sep 17 00:00:00 2001 From: Daniel Lo Nigro Date: Sun, 21 Sep 2014 20:55:14 -0700 Subject: [PATCH 2/2] Change key code 91 to Super and add F20 through F24 as per Mozilla docs --- src/browser/ui/dom/getEventKey.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/browser/ui/dom/getEventKey.js b/src/browser/ui/dom/getEventKey.js index f1fd3d7ff25..10607e3a143 100644 --- a/src/browser/ui/dom/getEventKey.js +++ b/src/browser/ui/dom/getEventKey.js @@ -67,12 +67,11 @@ var translateToKey = { 40: 'ArrowDown', 45: 'Insert', 46: 'Delete', - 91: 'Meta', // Left Command on Mac - 93: 'Meta', // Right Command on Mac + 91: 'Super', // Windows or Command key, depending on environment 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6', 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12', 124: 'F13', 125: 'F14', 126: 'F15', 127: 'F16', 128: 'F17', 129: 'F18', - 130: 'F19', + 130: 'F19', 131: 'F20', 132: 'F21', 133: 'F22', 134: 'F23', 135: 'F24', 144: 'NumLock', 145: 'ScrollLock', 224: 'Meta'