Skip to content

KeyInfo

The fields of a KeyboardEvent for one key.

key: string

KeyboardEvent.key: ’ ’, ‘Enter’, ‘ArrowLeft’, ‘a’…


code: string

KeyboardEvent.code: ‘Space’, ‘Enter’, ‘ArrowLeft’, ‘KeyA’…


keyCode: number

Legacy, still read by many games.