UtilOptional

KEYS

KeyboardEvent.key constants, plus the WrKey union of their values.

Usage

import { KEYS, type WrKey } from 'ngwr/utils';

if (event.key === KEYS.ESCAPE) {
  close();
}

function onArrow(key: WrKey) { /* … */ }

API

NameDescriptionTypeDefault
KEYSKeyboardEvent.key values: ENTER, ESCAPE, ARROW_UP, ARROW_DOWN, TAB, SPACE, …const record—
WrKeyUnion of every value in KEYS, for typed key parameters.type alias—

See also