mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-07 12:31:29 +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,4 +1,6 @@
|
||||
use crate::{event::{KeyboardEvent, PointerEvent}, consumer::SyncConsumer};
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use crate::{event::{KeyboardEvent, PointerEvent}, consumer::EventConsumer};
|
||||
use winapi::{
|
||||
self,
|
||||
um::winuser::{INPUT, INPUT_MOUSE, LPINPUT, MOUSEEVENTF_MOVE, MOUSEINPUT,
|
||||
@@ -25,8 +27,9 @@ impl WindowsConsumer {
|
||||
pub fn new() -> Self { Self { } }
|
||||
}
|
||||
|
||||
impl SyncConsumer for WindowsConsumer {
|
||||
fn consume(&mut self, event: Event, _: ClientHandle) {
|
||||
#[async_trait]
|
||||
impl EventConsumer for WindowsConsumer {
|
||||
async fn consume(&mut self, event: Event, _: ClientHandle) {
|
||||
match event {
|
||||
Event::Pointer(pointer_event) => match pointer_event {
|
||||
PointerEvent::Motion {
|
||||
@@ -48,9 +51,11 @@ impl SyncConsumer for WindowsConsumer {
|
||||
}
|
||||
}
|
||||
|
||||
fn notify(&mut self, _: ClientEvent) {
|
||||
async fn notify(&mut self, _: ClientEvent) {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
async fn destroy(&mut self) {}
|
||||
}
|
||||
|
||||
fn send_mouse_input(mi: MOUSEINPUT) {
|
||||
|
||||
Reference in New Issue
Block a user