swap_modifier_key()
This commit is contained in:
parent
edff4acbcb
commit
f438dd9fd0
@ -202,15 +202,8 @@ pub fn update_grab_get_key_name() {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
static mut IS_0X021D_DOWN: bool = false;
|
static mut IS_0X021D_DOWN: bool = false;
|
||||||
|
|
||||||
pub fn start_grab_loop() {
|
fn swap_modifier_key(mut event: Event) -> Event {
|
||||||
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
|
||||||
std::thread::spawn(move || {
|
|
||||||
let try_handle_keyboard = move |mut event: Event, key: Key, is_press: bool| -> Option<Event> {
|
|
||||||
// fix #2211:CAPS LOCK don't work
|
|
||||||
if key == Key::CapsLock || key == Key::NumLock {
|
|
||||||
return Some(event);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
let mut allow_swap_key = false;
|
let mut allow_swap_key = false;
|
||||||
#[cfg(not(any(feature = "flutter", feature = "cli")))]
|
#[cfg(not(any(feature = "flutter", feature = "cli")))]
|
||||||
if let Some(session) = CUR_SESSION.lock().unwrap().as_ref() {
|
if let Some(session) = CUR_SESSION.lock().unwrap().as_ref() {
|
||||||
@ -260,8 +253,19 @@ pub fn start_grab_loop() {
|
|||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
};
|
event
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn start_grab_loop() {
|
||||||
|
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
||||||
|
std::thread::spawn(move || {
|
||||||
|
let try_handle_keyboard = move |event: Event, key: Key, is_press: bool| -> Option<Event> {
|
||||||
|
// fix #2211:CAPS LOCK don't work
|
||||||
|
if key == Key::CapsLock || key == Key::NumLock {
|
||||||
|
return Some(event);
|
||||||
|
}
|
||||||
|
let event = swap_modifier_key(event);
|
||||||
|
|
||||||
let mut _keyboard_mode = KeyboardMode::Map;
|
let mut _keyboard_mode = KeyboardMode::Map;
|
||||||
let _scan_code = event.scan_code;
|
let _scan_code = event.scan_code;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user