fix: double space on Ctrl+Space toggle (flush char forwarded twice when engine disabled)
Some checks are pending
Build & Release / Build & test (push) Waiting to run
Build & Release / Build .deb (push) Blocked by required conditions

This commit is contained in:
Khoa Vo 2026-07-01 11:34:25 +07:00
parent 81a2baa5eb
commit ff607f0559

View file

@ -1208,9 +1208,11 @@ fn run_with_evdev(
if !commands.is_empty() {
consumed_keys.insert(keycode);
execute_commands(&*injector, &commands, false);
// Flush chars: forward raw key after injection
// (engine no longer includes flush char in insert)
if is_flush_char(ch) {
// Flush chars: forward raw key after injection.
// When engine is disabled (English mode), the Insert event
// already contains the character — forwarding raw key
// would double-inject (double space on Ctrl+Space toggle).
if is_flush_char(ch) && daemon.engine.is_enabled() {
injector.send_key_event(keycode, 1);
injector.send_key_event(keycode, 0);
}