From 6a8683304cf1a88d72fb348616b26487ef370922 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 13 Dec 2021 22:14:12 -0800 Subject: [PATCH] Revert "Set relative axes" This reverts commit 4b33dee052352ec8f938e6908ee74636be502b24. --- src/main.rs | 7 +++---- src/output.rs | 11 ++--------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index acbc133..3af4a7f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,10 +13,9 @@ fn event_loop(input_device: &mut Device) -> Result<(), Box> { } for event in input_device.fetch_events().unwrap() { - println!("event: {:?}", event); - //if event.event_type() == EventType::KEY { - // println!("event: {:?}", event); - //} + if event.event_type() == EventType::KEY { + println!("event: {:?}", event); + } output_device.emit(&[event]).unwrap(); } } diff --git a/src/output.rs b/src/output.rs index df633e9..45cd3f8 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,20 +1,13 @@ use evdev::uinput::{VirtualDevice, VirtualDeviceBuilder}; -use evdev::{AttributeSet, Device, RelativeAxisType}; +use evdev::{Device}; use std::error::Error; pub fn build_device(base_device: &Device) -> Result> { - let mut rel_axes = AttributeSet::::new(); - rel_axes.insert(evdev::RelativeAxisType::REL_X); - rel_axes.insert(evdev::RelativeAxisType::REL_Y); - rel_axes.insert(evdev::RelativeAxisType::REL_HWHEEL); - rel_axes.insert(evdev::RelativeAxisType::REL_WHEEL); - rel_axes.insert(evdev::RelativeAxisType::REL_MISC); - let device = VirtualDeviceBuilder::new()? .name("xremap") .with_keys(base_device.supported_keys().unwrap())? - .with_relative_axes(&rel_axes)? .build() .unwrap(); + Ok(device) }