KeyUp

View source

Captures the keyboard data from a browser keyup event.

Construct this value from the event when handling a released key. It keeps the browser’s key identity, physical code, keyboard location, and target.

Examples

const up = new KeyUp(new KeyboardEvent('keyup', {
  key: 'a',
  code: 'KeyA'
}))

console.log(up.key, up.code) // a KeyA

Constructor


constructor(event: KeyboardEvent)

View source

Copies key, code, location, and target from the browser event.

Parameters

NameDescriptionDefault
event

Browser keyboard event to capture.

—

Properties


target: EventTarget

View source

The event target copied from event.target, or null when the browser event has no target.