translate mode, mac --> win, init debug

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-02-14 15:42:02 +08:00
parent 50ce57024c
commit 7dfcc401e5
5 changed files with 77 additions and 32 deletions

View File

@@ -1093,16 +1093,16 @@ fn translate_process_code(code: u32, down: bool) {
}
fn translate_keyboard_mode(evt: &KeyEvent) {
match evt.union {
match &evt.union {
Some(key_event::Union::Seq(seq)) => {
ENIGO.lock().unwrap().key_sequence(&seq);
ENIGO.lock().unwrap().key_sequence(seq);
}
Some(key_event::Union::Chr(..)) =>
{
#[cfg(target_os = "windows")]
translate_process_code(evt.chr(), evt.down);
#[cfg(not(target_os = "windows"))]
sim_rdev_rawkey_position(code, down);
sim_rdev_rawkey_position(evt.chr(), evt.down);
}
Some(key_event::Union::Unicode(..)) => {
// Do not handle unicode for now.