temp commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-02-10 09:03:19 +08:00
parent cea123c79f
commit 50f751c215
2 changed files with 9 additions and 4 deletions

View File

@ -759,10 +759,12 @@ pub fn map_keyboard_mode(event: &Event, mut key_event: KeyEvent) -> Option<KeyEv
fn try_fill_unicode(event: &Event, key_event: &KeyEvent, events: &mut Vec<KeyEvent>) {
match &event.unicode {
Some(unicode_info) => {
for code in &unicode_info.unicode {
let mut evt = key_event.clone();
evt.set_unicode(*code as _);
events.push(evt);
if let Some(name) = unicode_info.name {
if name.len() > 0 {
let mut evt = key_event.clone();
evt.set_seq(name);
events.push(evt);
}
}
}
None => {}

View File

@ -1093,6 +1093,9 @@ fn translate_keyboard_mode(evt: &KeyEvent) {
#[cfg(target_os = "windows")]
allow_err!(rdev::simulate_unicode(_unicode as _));
}
Some(key_event::Union::Seq(seq)) => {
ENIGO.lock().unwrap().key_sequence(&seq);
}
Some(key_event::Union::Chr(..)) =>
{
#[cfg(target_os = "windows")]