mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 07:43:01 +08:00
Fix sycn of CapsLock
This commit is contained in:
parent
d0702ddfd9
commit
b3b50829f5
@ -822,6 +822,11 @@ fn legacy_keyboard_mode(evt: &KeyEvent) {
|
||||
}
|
||||
|
||||
fn translate_keyboard_mode(evt: &KeyEvent) {
|
||||
// Caps affects the keycode map of the peer system(Linux).
|
||||
let mut en = ENIGO.lock().unwrap();
|
||||
if en.get_key_state(Key::CapsLock){
|
||||
rdev_key_click(RdevKey::CapsLock);
|
||||
}
|
||||
let chr = char::from_u32(evt.chr()).unwrap_or_default();
|
||||
if evt.down {
|
||||
KBD_CONTEXT.lock().unwrap().unicode_char_down(chr).expect("unicode_char_down error");
|
||||
|
@ -1122,6 +1122,10 @@ impl Handler {
|
||||
if key == RdevKey::AltGr || evt.scan_code == 541 {
|
||||
return;
|
||||
}
|
||||
// Caps affects the keycode map of the peer system(Linux).
|
||||
if key == RdevKey::CapsLock {
|
||||
return;
|
||||
}
|
||||
dbg!(key);
|
||||
self.map_keyboard_mode(down_or_up, key, None);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user