fix: wayland CapsLock (#9641)

* fix: wayland CapsLock

Signed-off-by: fufesou <linlong1266@gmail.com>

* unformat for less changes

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: input, LockModes, do not check evt.down

Remove `evt.down`(revert the change) to avoid potential bugs.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-10-14 11:46:28 +08:00
committed by GitHub
parent af610b2408
commit 498b8ba3d6
2 changed files with 35 additions and 5 deletions

View File

@@ -431,8 +431,8 @@ pub mod service {
allow_err!(keyboard.emit(&[down_event]));
}
DataKeyboard::KeyUp(enigo::Key::Raw(code)) => {
let down_event = InputEvent::new(EventType::KEY, *code - 8, 0);
allow_err!(keyboard.emit(&[down_event]));
let up_event = InputEvent::new(EventType::KEY, *code - 8, 0);
allow_err!(keyboard.emit(&[up_event]));
}
DataKeyboard::KeyDown(key) => {
if let Ok((k, is_shift)) = map_key(key) {