Skip to content

Input: a keyboard holds its own modifiers, and one that goes lets go no other's - #130

Merged
aoinoikaz merged 1 commit into
mainfrom
keys-modifiers-per-keyboard
Nov 12, 2026
Merged

aoinoikaz merged 1 commit into
mainfrom
keys-modifiers-per-keyboard

Conversation

@aoinoikaz

Copy link
Copy Markdown
Contributor

The compositor and the console keep one flat set of the modifiers held, which a keyboard's close clears whole. A keyboard that sends a key and goes, as a driver's restart makes it, lets go the Control and Alt another keyboard holds, so the Delete pressed next on that keyboard is sent to a window and is not the secure attention key.

lib/keymap.c records the modifier keys held for each keyboard, numbered by its endpoint's place among the INPUT_DEVICES_MAX a client reads. A modifier is held while any keyboard holds a key of it, so Control on one keyboard still combines with a key of another, and a release or a close lets go that keyboard's keys alone. Caps Lock stays one state. display.md D19's rule 6 gives the rule, with the flat set and a set for each keyboard that does not combine as not taken.

Checked: tools/check-keyroute.c, 18,115,551 checks with one to four keyboards, and tools/check-text.c; both fail against a going that clears every keyboard; the default, fallback and window boots under TCG; 73 of 73 files against SHA256SUMS.

Not checked: two keyboards in a guest. The boots have one, so the compositor's and the console's calls at a keyboard's close are read and not run.

Based on #129, which this follows.

Closes #107

Base automatically changed from console-drop-setup-background to main November 12, 2026 16:43
…no other's

The compositor and the console kept one flat set of the modifiers held,
which every keyboard's keys changed and a keyboard's close cleared whole.
A keyboard that sent a key and went, as a driver's restart makes it, let
go the Control and Alt another keyboard held, so the Delete pressed next
on that keyboard was sent to a window and was not the secure attention
key.

lib/keymap.c records the modifier keys held for each keyboard, by the
number its caller gives it: the place of its endpoint among the
INPUT_DEVICES_MAX a client reads, as a button's source is. A modifier is
held while any keyboard holds a key of it, so Control on one keyboard
still combines with a key of another, and a release or a close lets go
that keyboard's keys alone. Caps Lock stays one state. The record of
presses sent, and what a window is sent when a keyboard goes, are as
they were.

display.md D19's rule 6 and its notes give the rule, with the flat set
and a set for each keyboard that does not combine as not taken, and D12
and console.md C3 point to it. The notes record what a modifier key held
on two keyboards costs: the window is sent the first release, which says
the modifier is still held, and not the second.

tools/check-keyroute.c and tools/check-text.c give each event a
keyboard: tables of two to four keyboards, sessions of one to four, and
a law read back from a session's log, that the modifiers a window is
sent are those any keyboard holds. A table's steps for a keyboard's
going and a window's are now marked by a value no event has. They were
marked by a code, and the keyboard's was 0xFFFF, which two tables also
press as a key, so those presses ran as goings.
@aoinoikaz
aoinoikaz force-pushed the keys-modifiers-per-keyboard branch from 1d80cfa to 52de68c Compare November 12, 2026 16:44
@aoinoikaz
aoinoikaz merged commit 4c53066 into main Nov 12, 2026
3 of 4 checks passed
@aoinoikaz
aoinoikaz deleted the keys-modifiers-per-keyboard branch November 12, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display: when the secure attention key can reach a window

1 participant