mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-08 04:20:01 +03:00
* Input capture and emulation can now be disabled and will prompt the user to enable again. * Improved error handling to deliver more useful error messages
33 lines
722 B
Rust
33 lines
722 B
Rust
use async_trait::async_trait;
|
|
use input_event::Event;
|
|
|
|
use crate::error::EmulationError;
|
|
|
|
use super::{EmulationHandle, InputEmulation};
|
|
|
|
#[derive(Default)]
|
|
pub struct DummyEmulation;
|
|
|
|
impl DummyEmulation {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
}
|
|
|
|
#[async_trait]
|
|
impl InputEmulation for DummyEmulation {
|
|
async fn consume(
|
|
&mut self,
|
|
event: Event,
|
|
client_handle: EmulationHandle,
|
|
) -> Result<(), EmulationError> {
|
|
log::info!("received event: ({client_handle}) {event}");
|
|
Ok(())
|
|
}
|
|
async fn create(&mut self, _: EmulationHandle) {}
|
|
async fn destroy(&mut self, _: EmulationHandle) {}
|
|
async fn terminate(&mut self) {
|
|
/* nothing to do */
|
|
}
|
|
}
|