Skip to content

inject: queue an input as if typed - #39

Merged
O6lvl4 merged 1 commit into
mainfrom
inject
Oct 1, 2026
Merged

O6lvl4 merged 1 commit into
mainfrom
inject

Conversation

@O6lvl4

@O6lvl4 O6lvl4 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

For a native menu bar whose items do what their key equivalents do. A menu item fires inside the event loop, and the key it takes never reaches the window. The program's own native code can call crate::window::inject(kind, code, mods) to hand the program the same input instead.

The inputs go to a thread-local queue apart from the host, because the host is borrowed while the loop runs. They join the window with the focus (else the current one) after each pump, and the loop is woken.

Checked: an injected TEXT 'c' with Super arrives after the window's FOCUS event, as kind 5, code 99, mods 8, window 1.

…m inside the event loop (a native menu's item)
@O6lvl4
O6lvl4 merged commit e2d23e3 into main Oct 1, 2026
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.

1 participant