fix: flush char forwarded as raw key — space no longer in clipboard paste
- Engine no longer includes flush char in Replace insert text - Daemon forwards raw flush key (space/enter/etc) after injection - Clipboard paste only contains the word, not trailing whitespace - Fixes 'thịtrâm' → 'thị trâm' (space reliably arrives via raw forward)
This commit is contained in:
parent
42e902a501
commit
758eea45b3
2 changed files with 9 additions and 2 deletions
|
|
@ -902,6 +902,12 @@ fn run_with_evdev(
|
||||||
if !commands.is_empty() {
|
if !commands.is_empty() {
|
||||||
consumed_keys.insert(keycode);
|
consumed_keys.insert(keycode);
|
||||||
execute_commands(&*injector, &commands, false);
|
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) {
|
||||||
|
injector.send_key_event(keycode, 1);
|
||||||
|
injector.send_key_event(keycode, 0);
|
||||||
|
}
|
||||||
// Skip upcoming auto-repeat pile-up from injection delay
|
// Skip upcoming auto-repeat pile-up from injection delay
|
||||||
skip_count = 3;
|
skip_count = 3;
|
||||||
} else if is_vn_control_key(&daemon.config.input_method, ch) {
|
} else if is_vn_control_key(&daemon.config.input_method, ch) {
|
||||||
|
|
|
||||||
|
|
@ -167,15 +167,16 @@ impl Engine {
|
||||||
self.reset();
|
self.reset();
|
||||||
return Some(EngineEvent::Replace {
|
return Some(EngineEvent::Replace {
|
||||||
backspaces: prev_len,
|
backspaces: prev_len,
|
||||||
insert: format!("{}{}", expansion, ch),
|
insert: expansion,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
self.reset();
|
self.reset();
|
||||||
if prev_len > 0 {
|
if prev_len > 0 {
|
||||||
|
// Don't include flush char in insert — daemon forwards it separately
|
||||||
return Some(EngineEvent::Replace {
|
return Some(EngineEvent::Replace {
|
||||||
backspaces: prev_len,
|
backspaces: prev_len,
|
||||||
insert: format!("{}{}", previous, ch),
|
insert: previous,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return None;
|
return None;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue