mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-14 09:21:29 +03:00
Fix sycn of CapsLock
This commit is contained in:
@@ -822,6 +822,11 @@ fn legacy_keyboard_mode(evt: &KeyEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn translate_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();
|
let chr = char::from_u32(evt.chr()).unwrap_or_default();
|
||||||
if evt.down {
|
if evt.down {
|
||||||
KBD_CONTEXT.lock().unwrap().unicode_char_down(chr).expect("unicode_char_down error");
|
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 {
|
if key == RdevKey::AltGr || evt.scan_code == 541 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Caps affects the keycode map of the peer system(Linux).
|
||||||
|
if key == RdevKey::CapsLock {
|
||||||
|
return;
|
||||||
|
}
|
||||||
dbg!(key);
|
dbg!(key);
|
||||||
self.map_keyboard_mode(down_or_up, key, None);
|
self.map_keyboard_mode(down_or_up, key, None);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user