Skip to content

macOS: decide the fate of the modifier-keycode arms — the tap mask never delivers FlagsChanged #4

Description

@vstrelnikof

Follow-up from #1 (review discussion).

The macOS listener's event tap subscribes to KeyDown + KeyUp only. macOS delivers modifier presses as FlagsChanged (event type 12) — so the keycode→modifier match arms added for Apple modifier keys are currently unreachable: no event carrying those keycodes ever enters the callback.

Modifier state is still correct today because it's folded from the event flags on ordinary key events (including CGEventFlagAlphaShift → shift), so this is not a user-visible bug — it's dead code plus an open design question:

Option A — subscribe to FlagsChanged and route it through the modifier arms. That would give the engine discrete modifier press/release events like the X11 and Windows backends get. Things to check: tap-callback cost (the handler must stay non-blocking), whether the word-boundary logic actually wants those events, and that injected-event stamping still filters our own emissions.

Option B — delete the unreachable arms and keep flags-folding as the single source of modifier truth on macOS, with a comment explaining why.

Where to look: crates/poltertype-input/src/macos.rs (tap creation + keycode table). A decision + small PR either way closes this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions