diff --git a/CHANGELOG.md b/CHANGELOG.md index ef2ae7b..e0c20c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - `PopupSurface::send_configure` now checks the protocol version and returns an `Result` - `KeyboardHandle::input` filter closure now receives a `KeysymHandle` instead of a `Keysym` and returns a `FilterResult`. +#### Backend + +- Added `TabletToolType::Unknown` as an option for tablet events + ### Additions #### Clients & Protocols diff --git a/Cargo.toml b/Cargo.toml index 47e7e28..1ac994b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ drm-fourcc = "^2.1.1" drm = { version = "0.5.0", optional = true } drm-ffi = { version = "0.2.0", optional = true } gbm = { version = "0.7.0", optional = true, default-features = false, features = ["drm-support"] } -input = { version = "0.6", default-features = false, features=["libinput_1_14"], optional = true } +input = { version = "0.7", default-features = false, features=["libinput_1_14"], optional = true } lazy_static = "1" libc = "0.2.103" libseat= { version = "0.1.1", optional = true } diff --git a/src/backend/input/tablet.rs b/src/backend/input/tablet.rs index d2bcc25..bb8a4e0 100644 --- a/src/backend/input/tablet.rs +++ b/src/backend/input/tablet.rs @@ -35,6 +35,8 @@ pub enum TabletToolType { Lens, /// A rotary device with positional and rotation data. Totem, + /// Type of the device is not known or does not match any known ones + Unknown, } bitflags! { diff --git a/src/backend/libinput/mod.rs b/src/backend/libinput/mod.rs index 2d9a76e..1677695 100644 --- a/src/backend/libinput/mod.rs +++ b/src/backend/libinput/mod.rs @@ -19,7 +19,7 @@ use std::{ use calloop::{EventSource, Interest, Mode, Poll, PostAction, Readiness, Token, TokenFactory}; -use slog::{info, o}; +use slog::{info, o, trace}; mod tablet; @@ -403,6 +403,9 @@ impl InputBackend for LibinputInputBackend { callback(InputEvent::DeviceRemoved { device: removed }); } + _ => { + trace!(self.logger, "Unknown libinput device event"); + } }, libinput::Event::Touch(touch_event) => match touch_event { event::TouchEvent::Down(down_event) => { @@ -420,11 +423,17 @@ impl InputBackend for LibinputInputBackend { event::TouchEvent::Frame(frame_event) => { callback(InputEvent::TouchFrame { event: frame_event }); } + _ => { + trace!(self.logger, "Unknown libinput touch event"); + } }, libinput::Event::Keyboard(keyboard_event) => match keyboard_event { event::KeyboardEvent::Key(key_event) => { callback(InputEvent::Keyboard { event: key_event }); } + _ => { + trace!(self.logger, "Unknown libinput keyboard event"); + } }, libinput::Event::Pointer(pointer_event) => match pointer_event { event::PointerEvent::Motion(motion_event) => { @@ -441,6 +450,9 @@ impl InputBackend for LibinputInputBackend { event::PointerEvent::Button(button_event) => { callback(InputEvent::PointerButton { event: button_event }); } + _ => { + trace!(self.logger, "Unknown libinput pointer event"); + } }, libinput::Event::Tablet(tablet_event) => match tablet_event { event::TabletToolEvent::Axis(event) => { @@ -455,6 +467,9 @@ impl InputBackend for LibinputInputBackend { event::TabletToolEvent::Button(event) => { callback(InputEvent::TabletToolButton { event }); } + _ => { + trace!(self.logger, "Unknown libinput tablet event"); + } }, _ => {} //FIXME: What to do with the rest. } diff --git a/src/backend/libinput/tablet.rs b/src/backend/libinput/tablet.rs index 666a540..0e75ef3 100644 --- a/src/backend/libinput/tablet.rs +++ b/src/backend/libinput/tablet.rs @@ -57,14 +57,15 @@ where let tool = self.tool(); let tool_type = match tool.tool_type() { - tablet_tool::TabletToolType::Pen => TabletToolType::Pen, - tablet_tool::TabletToolType::Eraser => TabletToolType::Eraser, - tablet_tool::TabletToolType::Brush => TabletToolType::Brush, - tablet_tool::TabletToolType::Pencil => TabletToolType::Pencil, - tablet_tool::TabletToolType::Airbrush => TabletToolType::Airbrush, - tablet_tool::TabletToolType::Mouse => TabletToolType::Mouse, - tablet_tool::TabletToolType::Lens => TabletToolType::Lens, - tablet_tool::TabletToolType::Totem => TabletToolType::Totem, + Some(tablet_tool::TabletToolType::Pen) => TabletToolType::Pen, + Some(tablet_tool::TabletToolType::Eraser) => TabletToolType::Eraser, + Some(tablet_tool::TabletToolType::Brush) => TabletToolType::Brush, + Some(tablet_tool::TabletToolType::Pencil) => TabletToolType::Pencil, + Some(tablet_tool::TabletToolType::Airbrush) => TabletToolType::Airbrush, + Some(tablet_tool::TabletToolType::Mouse) => TabletToolType::Mouse, + Some(tablet_tool::TabletToolType::Lens) => TabletToolType::Lens, + Some(tablet_tool::TabletToolType::Totem) => TabletToolType::Totem, + _ => TabletToolType::Unknown, }; let hardware_serial = tool.serial();