mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-14 11:39:04 +08:00
rename: sync status && add numlock capslock
This commit is contained in:
parent
14e21863ba
commit
d675bfa7e3
@ -264,7 +264,7 @@ pub fn get_keyboard_mode_enum() -> KeyboardMode {
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn add_numlock_capslock_state(key_event: &mut KeyEvent) {
|
||||
pub fn add_numlock_capslock_status(key_event: &mut KeyEvent) {
|
||||
if get_key_state(enigo::Key::CapsLock) {
|
||||
key_event.modifiers.push(ControlKey::CapsLock.into());
|
||||
}
|
||||
@ -341,7 +341,7 @@ pub fn event_to_key_event(event: &Event) -> KeyEvent {
|
||||
}
|
||||
};
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
add_numlock_capslock_state(&mut key_event);
|
||||
add_numlock_capslock_status(&mut key_event);
|
||||
|
||||
return key_event;
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ fn click_numlock(en: &mut Enigo) {
|
||||
en.key_click(enigo::Key::NumLock);
|
||||
}
|
||||
|
||||
fn sync_status(key_event: &KeyEvent) {
|
||||
fn sync_numlock_capslock_status(key_event: &KeyEvent) {
|
||||
let mut en = ENIGO.lock().unwrap();
|
||||
|
||||
let client_caps_locking = is_modifier_in_key_event(ControlKey::CapsLock, key_event);
|
||||
@ -851,7 +851,7 @@ fn sync_status(key_event: &KeyEvent) {
|
||||
}
|
||||
|
||||
if need_click_numlock && !disable_numlock {
|
||||
click_capslock(&mut en);
|
||||
click_numlock(&mut en);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1001,7 +1001,7 @@ pub fn handle_key_(evt: &KeyEvent) {
|
||||
}
|
||||
|
||||
if evt.down {
|
||||
sync_status(evt)
|
||||
sync_numlock_capslock_status(evt)
|
||||
}
|
||||
match evt.mode.unwrap() {
|
||||
KeyboardMode::Map => {
|
||||
|
Loading…
Reference in New Issue
Block a user