UNPKG

1.58 kBSource Map (JSON)View Raw
1{"version":3,"file":"keyboard.js","sourceRoot":"../src/","sources":["keyboard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAM,mBAAmB;IACvB,GAAC,QAAQ,CAAC,EAAE,IAAG,CAAC;IAChB,GAAC,QAAQ,CAAC,IAAI,IAAG,CAAC;IAClB,GAAC,QAAQ,CAAC,IAAI,IAAG,CAAC;IAClB,GAAC,QAAQ,CAAC,KAAK,IAAG,CAAC;IACnB,GAAC,QAAQ,CAAC,IAAI,IAAG,CAAC;IAClB,GAAC,QAAQ,CAAC,GAAG,IAAG,CAAC;IACjB,GAAC,QAAQ,CAAC,GAAG,IAAG,CAAC;IACjB,GAAC,QAAQ,CAAC,MAAM,IAAG,CAAC;IACpB,GAAC,QAAQ,CAAC,QAAQ,IAAG,CAAC;OACvB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { KeyCodes } from './KeyCodes';\n\nconst DirectionalKeyCodes: { [key: number]: number } = {\n [KeyCodes.up]: 1,\n [KeyCodes.down]: 1,\n [KeyCodes.left]: 1,\n [KeyCodes.right]: 1,\n [KeyCodes.home]: 1,\n [KeyCodes.end]: 1,\n [KeyCodes.tab]: 1,\n [KeyCodes.pageUp]: 1,\n [KeyCodes.pageDown]: 1,\n};\n\n/**\n * Returns true if the keycode is a directional keyboard key.\n */\nexport function isDirectionalKeyCode(which: number): boolean {\n return !!DirectionalKeyCodes[which];\n}\n\n/**\n * Adds a keycode to the list of keys that, when pressed, should cause the focus outlines to be visible.\n * This can be used to add global shortcut keys that directionally move from section to section within\n * an app or between focus trap zones.\n */\nexport function addDirectionalKeyCode(which: number): void {\n DirectionalKeyCodes[which] = 1;\n}\n"]}
\No newline at end of file