API / @aionbuilders/nabu/extend

eventChord

Function Stability: stable

Normalize a keyboard event to a chord, with the rules of the module doc.

Related guide: Commands and keymap →

Signature

TypeScript
import { eventChord } from '@aionbuilders/nabu/extend';
TypeScript
function eventChord(event: Pick<KeyboardEvent, 'key'> & Partial<KeyboardEvent>): Chord | null

Parameters

Parameters of eventChord
ParameterTypeDescription
eventPick<KeyboardEvent, 'key'> & Partial<KeyboardEvent>n/a

Returns

Chord | null

null for a pure modifier press, an AltGraph keystroke, or an event with no usable key

Source: src/lib/utils/keys.js:126