# ally.map.keycode
Map human readable names for event.keyCodes.
# Description
// example structure
var map = {
// Element Focus
tab: 9,
// Navigation
left: 37,
up: 38,
// ...
home: 36,
// Action
enter: 13,
escape: 27,
space: 32,
// Function keys
f1: 112,
// ...
// Numeric keys
0: 48,
1: 49,
// ...
'num-0': 96,
'num-1': 97,
// ...
// Latin characters
a: 65,
// ...
z: 90,
};
The map knows the following keys:
a-z0-9num-0-num-9(number block)f1-f25(function keys)down,left,right,up(arrow keys)end,home,pageDown,page-down,pageUp,page-upenter,escape,space,tabalt,capsLock,caps-lock,ctrl,meta,shiftpause,insert,delete,backspace
# Usage
console.log('keycode of enter', ally.map.keycode.enter);
# Changes
v1.1.0replaced the keycommandbymeta.v1.1.0addeda-z,0-9,num-0-num-9,f13-f25,page-down,page-up,caps-lock.v1.1.0added_aliasto resolve multiple keyCodes for the same logical key.
# Notes
The key meta is known by different keyCodes: 91, 92, 93, 224 - which ally.map.keycodes.alias.91 helps to resolve. The same is true for numeric keys (0-9) and their counterparts on the numblock.
# Related resources
KeyboardEvent.keymay help deal with this mess in the future.