fix: revert non-grab mode to process_key with +1 backspace for control keys
This commit is contained in:
parent
3612939643
commit
e7b7864937
1 changed files with 20 additions and 19 deletions
|
|
@ -1205,27 +1205,28 @@ fn run_with_evdev(
|
||||||
}
|
}
|
||||||
|
|
||||||
if !grabbed {
|
if !grabbed {
|
||||||
// Non-grabbing mode: raw keystrokes reach the application
|
// Legacy mode: raw keystrokes reach the application directly.
|
||||||
// directly. Use Event Sourcing (replay_and_inject) which
|
// Use process_key for corrections; +1 backspace for control
|
||||||
// tracks what's actually on screen and computes corrections
|
// keys that landed on screen as literal characters.
|
||||||
// based on the screen state — not the engine's internal
|
if value != 1 {
|
||||||
// buffer. This avoids race conditions where a correction
|
continue;
|
||||||
// backspace removes the wrong characters because the user
|
}
|
||||||
// typed more while the clipboard paste was in flight.
|
if is_modifier_pressed(&key_state) {
|
||||||
if value == 1 {
|
continue;
|
||||||
if is_modifier_pressed(&key_state) {
|
}
|
||||||
continue;
|
if let Some(ch) = key_to_char(key) {
|
||||||
}
|
let mut commands = daemon.process_key(ch);
|
||||||
if let Some(ch) = key_to_char(key) {
|
if !commands.is_empty()
|
||||||
if ch == '\x08' {
|
&& is_vn_control_key(&daemon.config.input_method, ch)
|
||||||
// Backspace: let the raw key through, but also
|
{
|
||||||
// update the event sourcing state.
|
for cmd in &mut commands {
|
||||||
daemon.replay_backspace();
|
if let OutputCommand::Backspace(ref mut n) = cmd {
|
||||||
} else {
|
*n += 1;
|
||||||
let commands = daemon.replay_and_inject(ch);
|
break;
|
||||||
execute_commands(&*injector, &commands, false);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
execute_commands(&*injector, &commands, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Grabbing mode: all output goes through uinput only.
|
// Grabbing mode: all output goes through uinput only.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue