mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-10 14:50:55 +03:00
@@ -5,6 +5,7 @@ use async_trait::async_trait;
|
||||
use std::collections::HashMap;
|
||||
use std::io;
|
||||
use std::os::fd::{AsFd, OwnedFd};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use wayland_client::backend::WaylandError;
|
||||
use wayland_client::WEnum;
|
||||
|
||||
@@ -177,6 +178,11 @@ struct VirtualInput {
|
||||
|
||||
impl VirtualInput {
|
||||
fn consume_event(&self, event: Event) -> Result<(), ()> {
|
||||
let now: u32 = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap_or_default()
|
||||
.as_millis() as u32;
|
||||
|
||||
match event {
|
||||
Event::Pointer(e) => {
|
||||
match e {
|
||||
@@ -197,7 +203,7 @@ impl VirtualInput {
|
||||
PointerEvent::AxisDiscrete120 { axis, value } => {
|
||||
let axis: Axis = (axis as u32).try_into()?;
|
||||
self.pointer
|
||||
.axis_discrete(0, axis, value as f64 / 6., value / 120);
|
||||
.axis_discrete(now, axis, value as f64 / 6., value / 120);
|
||||
self.pointer.frame();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user