Fix repeatedly releasing keys without char

This commit is contained in:
Asura 2022-08-12 00:05:31 -07:00
parent b916ef3659
commit 8310f38c15

View File

@ -1113,16 +1113,19 @@ impl Handler {
self.send_key_event(key_event, KeyboardMode::Translate);
}
} else {
if down_or_up == true {
TO_RELEASE.lock().unwrap().insert(key);
let success = if down_or_up == true {
TO_RELEASE.lock().unwrap().insert(key)
} else {
TO_RELEASE.lock().unwrap().remove(&key);
}
TO_RELEASE.lock().unwrap().remove(&key)
};
// AltGr && LeftControl(SpecialKey) without action
if key == RdevKey::AltGr || evt.scan_code == 541 {
return;
}
self.map_keyboard_mode(down_or_up, key, None);
if success{
self.map_keyboard_mode(down_or_up, key, None);
}
}
}