Skip to content

macOS: implement KeyEmitter::release_modifiers (chord-accepted suggestions can misfire) #5

Description

@vstrelnikof

KeyEmitter::release_modifiers (added in 0.6.0 for the suggestions feature) has a default no-op implementation, and the macOS emitter inherits it.

Consequence: accepting a spelling suggestion with Ctrl+Shift+<digit> can misfire on macOS — the user's physically-held modifiers aren't neutralised before the replacement text is emitted, so the retyped characters can come out modified (or trigger app shortcuts) depending on timing.

What's needed: post the appropriate flags-clearing / modifier key-up events via CGEvent before emitting the replacement, mirroring what the evdev and Windows emitters do, and make sure the synthetic events are stamped as injected (the stamping mechanism from 0.6.2 already exists) so the listener ignores them.

Where to look: crates/poltertype-input/src/macos.rs (emitter side), and the trait definition in poltertype-input for the contract. Testable on hardware with any two-layout setup: trigger a suggestion tooltip, accept via the chord while still holding the keys sloppily, watch what lands in the text field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdifficulty:mediumNeeds some familiarity with the codebaseplatform:macosmacOS-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions