From 1fbcb0c606b9b7a498feee50e8c865a3b98a4423 Mon Sep 17 00:00:00 2001 From: Jan Trefil <8711792+htrefil@users.noreply.github.com> Date: Tue, 20 Jun 2023 22:22:30 +0200 Subject: [PATCH] Turn MtBlobId into an axis --- rkvm-input/src/abs.rs | 5 +++-- rkvm-input/src/interceptor.rs | 1 - rkvm-input/src/writer.rs | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rkvm-input/src/abs.rs b/rkvm-input/src/abs.rs index a42f323..234ff67 100644 --- a/rkvm-input/src/abs.rs +++ b/rkvm-input/src/abs.rs @@ -6,8 +6,6 @@ use serde::{Deserialize, Serialize}; pub enum AbsEvent { Axis { axis: AbsAxis, value: i32 }, MtToolType { value: ToolType }, - // TODO: This might actually belong to the Axis variant. - MtBlobId { value: i32 }, } #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)] @@ -47,6 +45,7 @@ pub enum AbsAxis { MtOrientation, MtPositionX, MtPositionY, + MtBlobId, MtTrackingId, MtPressure, MtDistance, @@ -92,6 +91,7 @@ impl AbsAxis { glue::ABS_MT_ORIENTATION => Self::MtOrientation, glue::ABS_MT_POSITION_X => Self::MtPositionX, glue::ABS_MT_POSITION_Y => Self::MtPositionY, + glue::ABS_MT_BLOB_ID => Self::MtBlobId, glue::ABS_MT_TRACKING_ID => Self::MtTrackingId, glue::ABS_MT_PRESSURE => Self::MtPressure, glue::ABS_MT_DISTANCE => Self::MtDistance, @@ -140,6 +140,7 @@ impl AbsAxis { Self::MtOrientation => glue::ABS_MT_ORIENTATION, Self::MtPositionX => glue::ABS_MT_POSITION_X, Self::MtPositionY => glue::ABS_MT_POSITION_Y, + Self::MtBlobId => glue::ABS_MT_BLOB_ID, Self::MtTrackingId => glue::ABS_MT_TRACKING_ID, Self::MtPressure => glue::ABS_MT_PRESSURE, Self::MtDistance => glue::ABS_MT_DISTANCE, diff --git a/rkvm-input/src/interceptor.rs b/rkvm-input/src/interceptor.rs index db77c50..ebdcdb6 100644 --- a/rkvm-input/src/interceptor.rs +++ b/rkvm-input/src/interceptor.rs @@ -52,7 +52,6 @@ impl Interceptor { glue::ABS_MT_TOOL_TYPE => { ToolType::from_raw(value).map(|value| AbsEvent::MtToolType { value }) } - glue::ABS_MT_BLOB_ID => Some(AbsEvent::MtBlobId { value }), _ => AbsAxis::from_raw(code).map(|axis| AbsEvent::Axis { axis, value }), } .map(Event::Abs), diff --git a/rkvm-input/src/writer.rs b/rkvm-input/src/writer.rs index 70ed3d8..6ab5fd8 100644 --- a/rkvm-input/src/writer.rs +++ b/rkvm-input/src/writer.rs @@ -34,7 +34,6 @@ impl Writer { AbsEvent::MtToolType { value } => { (glue::EV_ABS, glue::ABS_MT_TOOL_TYPE as _, value.to_raw()) } - AbsEvent::MtBlobId { value } => (glue::EV_ABS, glue::ABS_MT_BLOB_ID as _, *value), }, Event::Key(KeyEvent { down, key }) => (glue::EV_KEY, key.to_raw(), *down as _), Event::Sync(event) => (glue::EV_SYN, event.to_raw(), 0),