react-hotkeys
Version:
A declarative library for handling hotkeys and focus within a React application
52 lines (48 loc) • 959 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* A mapping between Mousetrap syntax and React syntax to support the use of both
*/
var MousetrapToReactKeyNamesDictionary = {
/**
* Generic
*/
'tab': 'Tab',
'capslock': 'CapsLock',
'shift': 'Shift',
'meta': 'Meta',
'alt': 'Alt',
'ctrl': 'Control',
'space': ' ',
'spacebar': ' ',
'escape': 'Escape',
'esc': 'Escape',
'left': 'ArrowLeft',
'right': 'ArrowRight',
'up': 'ArrowUp',
'down': 'ArrowDown',
/**
* Mac
*/
'return': 'Enter',
'del': 'Delete',
'command': 'Meta',
'option': 'Alt',
/**
* Windows
*/
'enter': 'Enter',
'backspace': 'Backspace',
'ins': 'Insert',
'pageup': 'PageUp',
'pagedown': 'PageDown',
'end': 'End',
'home': 'Home',
'contextmenu': 'ContextMenu',
'numlock': 'Clear'
};
var _default = MousetrapToReactKeyNamesDictionary;
exports.default = _default;