hex/src/keyboard_input_sources
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dax 5c2b6b6580
fix windows annotate search: clicks, keys and click-away (#2113) (#2118)
A Rune overlay never takes the keyboard on Windows (its window is a no-activate
tool window, and Rune hands overlays the keyboard on macOS and Wayland only), and
Hex's Windows hooks never handed the finished capture capsule anything either. So
the search field's clicks fell through to the app in front, typing reached
nothing, and once the search opened there was no Escape, click-away or ✕ to
leave it.

- The search field is a native hit region on Windows (`.hit()`), so the window
  stops being click-through over it.
- The mouse hook reports `CapsuleKey::Press` while the capsule's list or
  suggestions are open, so a click away folds them and starts the hold that lets
  the capsule leave. The click is never consumed, and a press on the capsule's own
  boxes is its click.
- The keyboard hook hands the open list or the suggestions the keys
  `capture_host::list_key` names: text, ⌫, ↑↓, ⏎/⇧⏎, ⇥, Escape and Shift, and it
  keeps the caret's own keys (⌦, ←→, Home and End, Page Up and Page Down, Insert)
  from the app while the search is open. The layout is read only where the capsule
  can take text, with `ToUnicodeEx`'s "change no state" flag and a key state
  built from the hook's own Shift and Caps Lock, so a key that goes on to the app
  is never disturbed and a dead key types nothing. Only keys that edit text are
  taken: the lock, media, browser and launch keys, Print Screen, Sleep, Apps and
  function keys pass. Ctrl, Alt and the Windows key make a chord and stay the
  app's, and so do Hex's own shortcuts and Escape over the suggestions, as on the
  Mac.
- Every press the app gets is remembered until its release, wherever the capsule
  stood when it went down, so a key held while the search opens under it keeps its
  autorepeats and release with the app.

Checked by cross-compiling and by the hooks' unit tests; not observed on a real
Windows PC.
2026-11-20 20:24:28 -05:00
..
macos.rs Fix #1378: macOS main-thread pump idle wakeups (#1381) 2026-11-05 08:54:07 -05:00
windows.rs fix windows annotate search: clicks, keys and click-away (#2113) (#2118) 2026-11-20 20:24:28 -05:00
x11.rs Fold local transcription modules into transcription/ 2026-10-31 16:12:40 -07:00