rename: sync status && add numlock capslock

This commit is contained in:
asur4s 2022-12-13 15:40:44 -08:00
parent 14e21863ba
commit d675bfa7e3
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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 => {