The window lost keyboard focus.
The window has closed.
As frame, but the context is reset first, so each handler starts from
a blank canvas with default state. Listening for this at all is what
turns the clearing on; frame alone leaves the previous frame in place
to be drawn over.
How many frames have been drawn, counting from 0.
The window gained keyboard focus.
A new frame is due, numbered from 0. This is where to draw an
animation: the canvas is presented after the handler returns.
How many frames have been drawn, counting from 0.
The window entered or left fullscreen.
Whether the window is now fullscreen.
Text was entered, by keystroke or by input method. data is what was
inserted, and inputType what kind of edit it was.
The text that was inserted.
What kind of edit produced it.
A key went down, auto-repeats included.
A key came up.
A mouse button went down.
The cursor moved over the window.
A mouse button came up.
The window was moved, reporting its new screen position.
The window's new distance from the left of the screen, in points.
The window's new distance from the top of the screen, in points.
The window was resized, reporting its new size in points.
The window's new height, in points.
The window's new width, in points.
Emitted once, immediately before the first frame event, for one-time
initialization.
The scroll wheel or trackpad moved, in pixels.
Horizontal scroll since the last event, in pixels.
Vertical scroll since the last event, in pixels.
Every event a Window emits, and what each one carries. The object a handler receives also has
typeandtargetalongside these fields.🧪 Not in the HTML Canvas standard.