1
0
Fork 0
forked from wry/wry

autocommit 2022-02-14 21:47:35 CET

This commit is contained in:
Julian Orth 2022-02-14 21:47:35 +01:00
parent da6b29f138
commit 290225190a
11 changed files with 191 additions and 19 deletions

View file

@ -56,6 +56,21 @@ impl InputDevice {
}
}
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub enum Axis {
Horizontal,
Vertical,
}
impl Axis {
pub fn other(self) -> Self {
match self {
Self::Horizontal => Self::Vertical,
Self::Vertical => Self::Horizontal,
}
}
}
impl Seat {
#[doc(hidden)]
pub fn raw(self) -> u64 {
@ -87,15 +102,25 @@ impl Seat {
get!().seat_set_keymap(self, keymap)
}
pub fn set_repeat_rate(self, rate: i32, delay: i32) {
get!().seat_set_repeat_rate(self, rate, delay)
}
pub fn repeat_rate(self) -> (i32, i32) {
let mut res = (25, 250);
(|| res = get!().seat_get_repeat_rate(self))();
res
}
pub fn set_repeat_rate(self, rate: i32, delay: i32) {
get!().seat_set_repeat_rate(self, rate, delay)
}
pub fn split(self) -> Axis {
let mut res = Axis::Horizontal;
(|| res = get!().split(self))();
res
}
pub fn set_split(self, axis: Axis) {
get!().set_split(self, axis)
}
}
pub fn get_seats() -> Vec<Seat> {