UNPKG

react-hotkeys

Version:

A declarative library for handling hotkeys and focus within a React application

27 lines (22 loc) 536 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Returns the name of the event at a specified event record index * @param {KeyEventType} keyEventType * @returns {KeyEventName} Name of the key event */ function describeKeyEventType(keyEventType) { switch (parseInt(keyEventType, 10)) { case 0: return 'keydown'; case 1: return 'keypress'; default: return 'keyup'; } } var _default = describeKeyEventType; exports.default = _default;