mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-21 12:10:55 +03:00
add tests for capture and emulation
This commit is contained in:
10
src/event.rs
10
src/event.rs
@@ -1,3 +1,4 @@
|
||||
use crate::scancode;
|
||||
use anyhow::{anyhow, Result};
|
||||
use std::{
|
||||
error::Error,
|
||||
@@ -101,7 +102,14 @@ impl Display for KeyboardEvent {
|
||||
time: _,
|
||||
key,
|
||||
state,
|
||||
} => write!(f, "key({key}, {state})"),
|
||||
} => {
|
||||
let scan = scancode::Linux::try_from(*key);
|
||||
if let Ok(scan) = scan {
|
||||
write!(f, "key({scan:?}, {state})")
|
||||
} else {
|
||||
write!(f, "key({key}, {state})")
|
||||
}
|
||||
}
|
||||
KeyboardEvent::Modifiers {
|
||||
mods_depressed,
|
||||
mods_latched,
|
||||
|
||||
Reference in New Issue
Block a user