mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-09 06:51:27 +03:00
Libei support - input emulation (#33)
Add support for input emulation through libei!
This commit is contained in:
committed by
Ferdinand Schober
parent
e6677c3061
commit
74eebc07d8
@@ -1,42 +1,32 @@
|
||||
use std::io::Result;
|
||||
use std::os::fd::{AsRawFd, self};
|
||||
use std::vec::Drain;
|
||||
use std::io;
|
||||
use std::task::Poll;
|
||||
|
||||
use tokio::io::unix::AsyncFd;
|
||||
|
||||
use futures_core::Stream;
|
||||
|
||||
use crate::event::Event;
|
||||
use crate::producer::EventProducer;
|
||||
|
||||
use crate::client::{ClientEvent, ClientHandle};
|
||||
|
||||
pub struct X11Producer {
|
||||
pending_events: Vec<(ClientHandle, Event)>,
|
||||
}
|
||||
pub struct X11Producer { }
|
||||
|
||||
impl X11Producer {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
pending_events: vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRawFd for X11Producer {
|
||||
fn as_raw_fd(&self) -> fd::RawFd {
|
||||
todo!()
|
||||
Self { }
|
||||
}
|
||||
}
|
||||
|
||||
impl EventProducer for X11Producer {
|
||||
fn notify(&mut self, _: ClientEvent) { }
|
||||
|
||||
fn read_events(&mut self) -> Drain<(ClientHandle, Event)> {
|
||||
self.pending_events.drain(..)
|
||||
}
|
||||
|
||||
fn release(&mut self) {}
|
||||
}
|
||||
|
||||
fn get_async_fd(&self) -> Result<AsyncFd<fd::RawFd>> {
|
||||
todo!()
|
||||
impl Stream for X11Producer {
|
||||
type Item = io::Result<(ClientHandle, Event)>;
|
||||
|
||||
fn poll_next(self: std::pin::Pin<&mut Self>, _cx: &mut std::task::Context<'_>) -> std::task::Poll<Option<Self::Item>> {
|
||||
Poll::Pending
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user