luvcraft/clim/input.lisp
An auto-repeat is one keystroke still held down, not another one: a verb fires once, while a movement key wants every repeat it can get.
The release matching a focus-changing Tab is swallowed below, so a shell that has just been focused does not read a stray Tab-up.
Whatever no layer claimed belongs to the focus, and if nothing is focused it belongs to nobody: the player controller reads an intent now, not a record of which keys happened to be down.
A native destination with a lifetime and frame clock.
(session event)The command SESSION's current input layer binds to key EVENT, or NIL. The window layer answers first and cannot be shadowed. After it, a focused object is asked through its own table and an unfocused player through the world's, so a key reaches exactly one layer.
(session)Logical conjunction of tests and raw truth values.
Keyboard dispatch.
This is the method that used to live in LUVCRAFT/RENDER.LISP as a ladder of WHEN ... RETURN-FROM guards, one per global key, each of which had to be placed above or below the focus dispatch by hand. What is left after the verbs became commands is the part that was never really about verbs: a keystroke lookup, the focus's claim on everything else, and the held-key state the player controller reads every physics step.
It runs on the canvas thread, and so does every command it executes: EXECUTE-FRAME-COMMAND applies a command directly while the frame has no process of its own. That is what makes it safe for a command to touch the session and the world at all.