mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
Merge pull request #387 from wizzard0/p3519-1-stray-keys
Fix #386: Ignore key codes over 0xf000 on insert
This commit is contained in:
commit
27592f71a1
1 changed files with 16 additions and 12 deletions
|
|
@ -938,18 +938,22 @@ fn main() -> ! {
|
|||
#[cfg(all(feature="debuginject", not(feature="rawserial")))]
|
||||
if let Some(conn) = listener_conn {
|
||||
if key != '\u{0000}' {
|
||||
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::Message::new_scalar(listener_op.unwrap(),
|
||||
key as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
)
|
||||
).unwrap_or_else(|_| {
|
||||
log::info!("Input overflow, dropping keys!");
|
||||
xous::Result::Ok
|
||||
});
|
||||
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
|
||||
xous::try_send_message(conn,
|
||||
xous::Message::new_scalar(listener_op.unwrap(),
|
||||
key as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
'\u{0000}' as u32 as usize,
|
||||
)
|
||||
).unwrap_or_else(|_| {
|
||||
log::info!("Input overflow, dropping keys!");
|
||||
xous::Result::Ok
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue