UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

10 lines 710 B
import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ENTER, ESCAPE, SPACE, TAB, } from '../../constants/keyboardKeys/keyboardKeys'; export const isKeyEnterPressed = (key) => key === ENTER.key; export const isKeySpacePressed = (key) => key === SPACE.key; export const isArrowLeftPressed = (key) => key === ARROW_LEFT.key; export const isArrowRightPressed = (key) => key === ARROW_RIGHT.key; export const isArrowDownPressed = (key) => key === ARROW_DOWN.key; export const isArrowUpPressed = (key) => key === ARROW_UP.key; export const isKeyEscapePressed = (key) => ESCAPE.key.some(escKey => escKey === key); export const isKeyTabPressed = (key) => key === TAB.key; //# sourceMappingURL=keyboard.utility.js.map