1
0
Fork 0
forked from wry/wry

autocommit 2022-03-30 22:27:19 CEST

This commit is contained in:
Julian Orth 2022-03-30 22:27:19 +02:00
parent a8136ed88c
commit ab4ac883ee
19 changed files with 434 additions and 76 deletions

View file

@ -1,5 +1,5 @@
use bincode::{Decode, Encode};
use crate::Seat;
use bincode::{Decode, Encode};
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub struct InputDevice(pub u64);
@ -12,6 +12,22 @@ impl InputDevice {
pub fn has_capability(self, cap: Capability) -> bool {
get!(false).has_capability(self, cap)
}
pub fn set_left_handed(self, left_handed: bool) {
get!().set_left_handed(self, left_handed);
}
pub fn set_accel_profile(self, profile: AccelProfile) {
get!().set_accel_profile(self, profile);
}
pub fn set_accel_speed(self, speed: f64) {
get!().set_accel_speed(self, speed);
}
pub fn set_transform_matrix(self, matrix: [[f64; 2]; 2]) {
get!().set_transform_matrix(self, matrix);
}
}
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
@ -24,3 +40,9 @@ pub const CAP_TABLET_TOOL: Capability = Capability(3);
pub const CAP_TABLET_PAD: Capability = Capability(4);
pub const CAP_GESTURE: Capability = Capability(5);
pub const CAP_SWITCH: Capability = Capability(6);
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub struct AccelProfile(pub u32);
pub const ACCEL_PROFILE_FLAT: AccelProfile = AccelProfile(1 << 0);
pub const ACCEL_PROFILE_ADAPTIVE: AccelProfile = AccelProfile(1 << 1);