input: move shared types into workspace crate
This commit is contained in:
parent
54aefd8c41
commit
151dc313ba
5 changed files with 126 additions and 70 deletions
|
|
@ -18,7 +18,6 @@ use {
|
|||
TabletStripEventSource, TabletToolChanges, TabletToolId, TabletToolInit,
|
||||
ToolButtonState,
|
||||
},
|
||||
wl_pointer::{CONTINUOUS, FINGER, HORIZONTAL_SCROLL, VERTICAL_SCROLL, WHEEL},
|
||||
},
|
||||
},
|
||||
libinput::consts::DeviceCapability,
|
||||
|
|
@ -43,6 +42,11 @@ use {
|
|||
|
||||
pub mod transaction;
|
||||
|
||||
pub use jay_input_types::{
|
||||
AXIS_120, AxisSource, ButtonState, InputDeviceAccelProfile, InputDeviceClickMethod, KeyState,
|
||||
LED_CAPS_LOCK, LED_COMPOSE, LED_KANA, LED_NUM_LOCK, LED_SCROLL_LOCK, Leds, ScrollAxis,
|
||||
};
|
||||
|
||||
linear_ids!(ConnectorIds, ConnectorId);
|
||||
linear_ids!(InputDeviceIds, InputDeviceId);
|
||||
linear_ids!(DrmDeviceIds, DrmDeviceId);
|
||||
|
|
@ -316,38 +320,6 @@ impl InputDeviceCapability {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Linearize)]
|
||||
pub enum InputDeviceAccelProfile {
|
||||
Flat,
|
||||
Adaptive,
|
||||
}
|
||||
|
||||
impl StaticText for InputDeviceAccelProfile {
|
||||
fn text(&self) -> &'static str {
|
||||
match self {
|
||||
InputDeviceAccelProfile::Flat => "Flat",
|
||||
InputDeviceAccelProfile::Adaptive => "Adaptive",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Linearize)]
|
||||
pub enum InputDeviceClickMethod {
|
||||
None,
|
||||
ButtonAreas,
|
||||
Clickfinger,
|
||||
}
|
||||
|
||||
impl StaticText for InputDeviceClickMethod {
|
||||
fn text(&self) -> &'static str {
|
||||
match self {
|
||||
InputDeviceClickMethod::None => "none",
|
||||
InputDeviceClickMethod::ButtonAreas => "button-areas",
|
||||
InputDeviceClickMethod::Clickfinger => "clickfinger",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum BackendEvent {
|
||||
NewDrmDevice(Rc<dyn BackendDrmDevice>),
|
||||
NewConnector(Rc<dyn Connector>),
|
||||
|
|
@ -355,43 +327,6 @@ pub enum BackendEvent {
|
|||
DevicesEnumerated,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum KeyState {
|
||||
Released,
|
||||
Pressed,
|
||||
Repeated,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum ButtonState {
|
||||
Released,
|
||||
Pressed,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq, Linearize)]
|
||||
pub enum ScrollAxis {
|
||||
Horizontal = HORIZONTAL_SCROLL as _,
|
||||
Vertical = VERTICAL_SCROLL as _,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum AxisSource {
|
||||
Wheel = WHEEL as _,
|
||||
Finger = FINGER as _,
|
||||
Continuous = CONTINUOUS as _,
|
||||
}
|
||||
|
||||
pub const AXIS_120: i32 = 120;
|
||||
|
||||
bitflags! {
|
||||
Leds: u32;
|
||||
LED_NUM_LOCK,
|
||||
LED_CAPS_LOCK,
|
||||
LED_SCROLL_LOCK,
|
||||
LED_COMPOSE,
|
||||
LED_KANA,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum InputEvent {
|
||||
Key {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue