feat: Support new keyboard mode

This commit is contained in:
Asura
2022-07-13 02:14:32 -07:00
parent 7b3b900764
commit 7fe2609ffb
5 changed files with 0 additions and 16 deletions

View File

@@ -589,10 +589,8 @@ fn handle_key_(evt: &KeyEvent) {
if keyboard_mode == 1 {
if let Some(key_event::Union::chr(chr)) = evt.union {
if evt.down {
println!("key down: {:?}", chr);
en.key_down(Key::Raw(chr.try_into().unwrap()));
} else {
println!("key up: {:?}", chr);
en.key_up(Key::Raw(chr.try_into().unwrap()));
}
}

View File

@@ -321,7 +321,6 @@ impl Handler {
}
MUTEX_SPECIAL_KEYS.lock().unwrap().insert(k, true);
}
println!("keydown {:?} {:?} {:?}", k, evt.code, evt.scan_code);
(k, 1)
}
KeyRelease(k) => {
@@ -329,7 +328,6 @@ impl Handler {
if MUTEX_SPECIAL_KEYS.lock().unwrap().contains_key(&k) {
MUTEX_SPECIAL_KEYS.lock().unwrap().insert(k, false);
}
println!("keyup {:?} {:?} {:?}", k, evt.code, evt.scan_code);
(k, 0)
}
_ => return,
@@ -339,11 +337,6 @@ impl Handler {
#[cfg(target_os = "windows")]
let key = rdev::get_win_key(evt.code.into(), evt.scan_code);
// todo: up down left right in numpad
// #[cfg(target_os = "linux")]
dbg!(key);
println!("--------------");
let mut key_event = KeyEvent::new();
// According to peer platform.
if peer == "Linux" {