diff --git a/index.js b/index.js index 21ed4cf..e837b2d 100644 --- a/index.js +++ b/index.js @@ -65,7 +65,6 @@ var codes = exports.code = exports.codes = { 'down': 40, 'insert': 45, 'delete': 46, - 'windows': 91, 'command': 91, 'right click': 93, 'numpad *': 106, @@ -88,20 +87,18 @@ var codes = exports.code = exports.codes = { '\\': 220, ']': 221, "'": 222, - '⇧': 16, - '⌥': 18, - '⌃': 17, - '⌘': 91, } // Helper aliases var aliases = exports.aliases = { - 'shift': 16, + 'windows': 91, + '⇧': 16, + '⌥': 18, + '⌃': 17, + '⌘': 91, 'ctl': 17, - 'ctrl': 17, 'control': 17, - 'alt': 18, 'option': 18, 'pause': 19, 'break': 19, diff --git a/test/keycode.js b/test/keycode.js index b1ebdb8..7485e77 100644 --- a/test/keycode.js +++ b/test/keycode.js @@ -91,3 +91,8 @@ it('exposes keycode/name maps', function() { } }) +it('should return shift, ctrl, and alt for 16, 17, and 18', function() { + assert.strictEqual(keycode(16), 'shift') + assert.strictEqual(keycode(17), 'ctrl') + assert.strictEqual(keycode(18), 'alt') +})