@scalar/oas-utils
Version:
Open API spec and Yaml handling utilities
121 lines (119 loc) • 1.69 kB
JavaScript
/**
* Array of all of the events that we support
*/
const HOTKEY_EVENT_NAMES = [
'addTopNav',
'closeModal',
'closeTopNav',
'createNew',
'executeRequest',
'focusAddressBar',
'focusRequestSearch',
'jumpToLastTab',
'jumpToTab',
'navigateSearchResultsDown',
'navigateSearchResultsUp',
'navigateTopNavLeft',
'navigateTopNavRight',
'openCommandPalette',
'selectSearchResult',
'toggleSidebar',
];
/**
* Array of all of the hotkeys that we support
*
* Space is a special case because its actually ' ' but we name it space here and will handle it separately
* If you need more
* @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
*/
const KEYDOWN_KEYS = [
'Space',
'Backspace',
'Tab',
'Enter',
'Escape',
'ArrowDown',
'ArrowLeft',
'ArrowRight',
'ArrowUp',
'End',
'Home',
'PageDown',
'PageUp',
'Delete',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'*',
'+',
'-',
'.',
'/',
'F1',
'F2',
'F3',
'F4',
'F5',
'F6',
'F7',
'F8',
'F9',
'F10',
'F11',
'F12',
';',
'=',
',',
'-',
'.',
'/',
'`',
'[',
'\\',
']',
'',
];
export { HOTKEY_EVENT_NAMES, KEYDOWN_KEYS };