Unable to send KeySequence from a blockable bind.
Title: Program freezes when sending KeySequence from a blockable bind
Description:
When attempting to send a KeySequence from a blockable bind in my program, the entire program freezes and locks the Windows input. This issue persists regardless of whether I block the input or not. Additionally, sending inputs using Enigo from a blockable bind (InputBot) also exhibits the same freezing behavior.
Steps to Reproduce:
- Use the following code snippet:
BKey.blockable_bind(move || {
KeySequence("Hello, World!").send();
BlockInput::DontBlock
})
Expected Behavior:
The program should send the specified KeySequence without freezing or locking the input.
Actual Behavior: The program freezes and locks the Windows input.
Environment:
- OS: Windows 11 (23H2)
- Rust version: 1.76.0
- InputBot: Branch develop, commit 2c506ab
- Enigo: 0.1.3
Read the comment in the blockable_bind example: https://github.com/obv-mikhail/InputBot/blob/develop/examples/blockable_binds.rs#L33
I need to be able to send inputs from the same thread as that will return the block result value sadly. I'm building a scriptable macro system where using Lua I could register hooks like onKeyDown and there return a true or false based on if it has to cancel it. as well as do actions like send text etc from it.
If I recall correctly, this is a limitation Windows, not of InputBot.