Merge pull request #387 from wizzard0/p3519-1-stray-keys

Fix #386: Ignore key codes over 0xf000 on insert
This commit is contained in:
bunnie 2023-05-21 21:16:44 +08:00 committed by GitHub
commit 27592f71a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -938,6 +938,9 @@ fn main() -> ! {
#[cfg(all(feature="debuginject", not(feature="rawserial")))] #[cfg(all(feature="debuginject", not(feature="rawserial")))]
if let Some(conn) = listener_conn { if let Some(conn) = listener_conn {
if key != '\u{0000}' { if key != '\u{0000}' {
if key >= '\u{f700}' && key <= '\u{f8ff}' {
log::info!("ignoring key '{}'({:x})", key, key as u32); // ignore Apple PUA characters
} else {
log::info!("injecting key '{}'({:x})", key, key as u32); // always be noisy about this, it's an exploit path log::info!("injecting key '{}'({:x})", key, key as u32); // always be noisy about this, it's an exploit path
xous::try_send_message(conn, xous::try_send_message(conn,
xous::Message::new_scalar(listener_op.unwrap(), xous::Message::new_scalar(listener_op.unwrap(),
@ -952,6 +955,7 @@ fn main() -> ! {
}); });
} }
} }
}
if observer_conn.is_some() && observer_op.is_some() { if observer_conn.is_some() && observer_op.is_some() {
log::trace!("sending observer key"); log::trace!("sending observer key");