Examples
setUpKeyboardEvents(world, canvas)Function
setUpKeyboardEvents(world: World, target: HTMLElement): voidForwards browser keyboard events from an HTMLElement to the typed
Events resources in a World. The keydown listener
queues a KeyDown value, and the keyup listener queues a
KeyUp value.
The matching Events<KeyUp> and Events<KeyDown> resources must already be
registered in world before this helper is called. Calling it again adds
another pair of listeners; it does not return a cleanup function or remove
listeners automatically.
setUpKeyboardEvents(world, canvas)