Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930/** * The key names a script may use with `press`, and what each is: the DOM `key` and `code`, Chrome's virtual key code, and the text it types, if any. * Browser-safe (the extension bundles it) and used by the runner for real key presses. */export interface KeySpec { key: string; code: string; vk: number; text?: string;}
export const KEYS: Readonly<Record<string, KeySpec>> = { Enter: { key: "Enter", code: "Enter", vk: 13, text: "\r" }, Tab: { key: "Tab", code: "Tab", vk: 9 }, Escape: { key: "Escape", code: "Escape", vk: 27 }, ArrowDown: { key: "ArrowDown", code: "ArrowDown", vk: 40 }, ArrowUp: { key: "ArrowUp", code: "ArrowUp", vk: 38 }, ArrowLeft: { key: "ArrowLeft", code: "ArrowLeft", vk: 37 }, ArrowRight: { key: "ArrowRight", code: "ArrowRight", vk: 39 }, Backspace: { key: "Backspace", code: "Backspace", vk: 8 }, Delete: { key: "Delete", code: "Delete", vk: 46 }, Space: { key: " ", code: "Space", vk: 32, text: " " }, Home: { key: "Home", code: "Home", vk: 36 }, End: { key: "End", code: "End", vk: 35 }, PageUp: { key: "PageUp", code: "PageUp", vk: 33 }, PageDown: { key: "PageDown", code: "PageDown", vk: 34 },};
export const KEY_NAMES: readonly string[] = Object.keys(KEYS);