1
0
Fork 0
forked from wry/wry

input: move backend events into type crate

This commit is contained in:
kossLAN 2026-05-29 12:58:17 -04:00
parent 03f35d7944
commit 524836bef3
No known key found for this signature in database
7 changed files with 208 additions and 191 deletions

View file

@ -6,12 +6,10 @@ use {
BackendConnectorTransactionType, BackendConnectorTransactionTypeDyn,
},
drm_feedback::DrmFeedback,
fixed::Fixed,
format::Format,
gfx_api::{FdSync, GfxApi, GfxFramebuffer},
video::drm::{ConnectorType, DrmConnector, DrmError, DrmVersion},
},
jay_config::input::SwitchEvent,
std::{
any::Any,
error::Error,
@ -34,11 +32,11 @@ pub use jay_output_types::{
pub use jay_input_types::{
AXIS_120, AxisSource, ButtonState, InputDeviceAccelProfile, InputDeviceCapability,
InputDeviceClickMethod, InputDeviceGroupId, InputDeviceGroupIds, InputDeviceId,
InputDeviceIds, KeyState, Leds, PadButtonState, ScrollAxis, TabletId, TabletIds, TabletInit,
TabletPadGroupInit, TabletPadId, TabletPadIds, TabletPadInit, TabletRingEventSource,
TabletStripEventSource, TabletTool2dChange, TabletToolCapability, TabletToolChanges,
TabletToolId, TabletToolIds, TabletToolInit, TabletToolPositionChange, TabletToolType,
TabletToolWheelChange, ToolButtonState, TransformMatrix,
InputDeviceIds, InputEvent, KeyState, Leds, PadButtonState, ScrollAxis, SwitchEvent, TabletId,
TabletIds, TabletInit, TabletPadGroupInit, TabletPadId, TabletPadIds, TabletPadInit,
TabletRingEventSource, TabletStripEventSource, TabletTool2dChange, TabletToolCapability,
TabletToolChanges, TabletToolId, TabletToolIds, TabletToolInit, TabletToolPositionChange,
TabletToolType, TabletToolWheelChange, ToolButtonState, TransformMatrix,
};
pub trait Backend: Any {
@ -218,179 +216,6 @@ pub enum BackendEvent {
DevicesEnumerated,
}
#[derive(Debug)]
pub enum InputEvent {
Key {
time_usec: u64,
key: u32,
state: KeyState,
},
ConnectorPosition {
time_usec: u64,
connector: ConnectorId,
x: Fixed,
y: Fixed,
},
Motion {
time_usec: u64,
dx: Fixed,
dy: Fixed,
dx_unaccelerated: Fixed,
dy_unaccelerated: Fixed,
},
MotionAbsolute {
time_usec: u64,
x_normed: f32,
y_normed: f32,
},
Button {
time_usec: u64,
button: u32,
state: ButtonState,
},
AxisPx {
dist: Fixed,
axis: ScrollAxis,
inverted: bool,
},
AxisSource {
source: AxisSource,
},
AxisStop {
axis: ScrollAxis,
},
Axis120 {
dist: i32,
axis: ScrollAxis,
inverted: bool,
},
AxisFrame {
time_usec: u64,
},
SwipeBegin {
time_usec: u64,
finger_count: u32,
},
SwipeUpdate {
time_usec: u64,
dx: Fixed,
dy: Fixed,
dx_unaccelerated: Fixed,
dy_unaccelerated: Fixed,
},
SwipeEnd {
time_usec: u64,
cancelled: bool,
},
PinchBegin {
time_usec: u64,
finger_count: u32,
},
PinchUpdate {
time_usec: u64,
dx: Fixed,
dy: Fixed,
dx_unaccelerated: Fixed,
dy_unaccelerated: Fixed,
scale: Fixed,
rotation: Fixed,
},
PinchEnd {
time_usec: u64,
cancelled: bool,
},
HoldBegin {
time_usec: u64,
finger_count: u32,
},
HoldEnd {
time_usec: u64,
cancelled: bool,
},
SwitchEvent {
time_usec: u64,
event: SwitchEvent,
},
TabletToolAdded {
time_usec: u64,
init: Box<TabletToolInit>,
},
TabletToolChanged {
time_usec: u64,
id: TabletToolId,
changes: Box<TabletToolChanges>,
},
TabletToolButton {
time_usec: u64,
id: TabletToolId,
button: u32,
state: ToolButtonState,
},
TabletToolRemoved {
time_usec: u64,
id: TabletToolId,
},
TabletPadButton {
time_usec: u64,
id: TabletPadId,
button: u32,
state: PadButtonState,
},
TabletPadModeSwitch {
time_usec: u64,
pad: TabletPadId,
group: u32,
mode: u32,
},
TabletPadRing {
time_usec: u64,
pad: TabletPadId,
ring: u32,
source: Option<TabletRingEventSource>,
angle: Option<f64>,
},
TabletPadStrip {
time_usec: u64,
pad: TabletPadId,
strip: u32,
source: Option<TabletStripEventSource>,
position: Option<f64>,
},
TabletPadDial {
time_usec: u64,
pad: TabletPadId,
dial: u32,
value120: i32,
},
TouchDown {
time_usec: u64,
id: i32,
x_normed: Fixed,
y_normed: Fixed,
},
TouchUp {
time_usec: u64,
id: i32,
},
TouchMotion {
time_usec: u64,
id: i32,
x_normed: Fixed,
y_normed: Fixed,
},
TouchCancel {
time_usec: u64,
id: i32,
},
TouchFrame {
time_usec: u64,
},
}
pub enum DrmEvent {
#[expect(dead_code)]
Removed,