Skip to content

Key-event prefix tracker as fallback when AX prefix is unavailable #17

@Jam-Cai

Description

@Jam-Cai

Some apps (Electron/Chromium, games, certain web text surfaces) don't expose AX text values reliably. FocusSnapshotResolver walks AX for prefix text; when the walk yields nothing usable, we lose the ability to suggest. Maintain a per-field prefix buffer driven by the existing CGEventTap keyDown stream, used as a fallback when the AX prefix is empty.

Acceptance

  • When AX prefix is unavailable for a focused editable field, key-event-reconstructed prefix is used as the request's prefixText.
  • Buffer clears on: focus change, arrow-key navigation, selection change, paste, undo.
  • Buffer never leaks across focused fields.
  • Config flag to disable the fallback entirely.
  • Unit tests cover keyDown handling, backspace, enter, focus reset.

Parent: #16

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:focusFocus tracking, AX, caret detectionenhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions