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

@ -2,6 +2,7 @@
use crate::_private::ipc::{ClientMessage, InitMessage, Response, ServerMessage};
use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION};
use crate::input::{AccelProfile, Capability, InputDevice};
use crate::keyboard::keymap::Keymap;
use crate::theme::Color;
use crate::{Axis, Command, Direction, LogLevel, ModifiedKeySym, Seat};
@ -11,7 +12,6 @@ use std::collections::HashMap;
use std::ops::Deref;
use std::rc::Rc;
use std::{ptr, slice};
use crate::input::{Capability, InputDevice};
pub(crate) struct Client {
configure: extern "C" fn(),
@ -318,6 +318,25 @@ impl Client {
self.send(&ClientMessage::SetSeat { device, seat })
}
pub fn set_left_handed(&self, device: InputDevice, left_handed: bool) {
self.send(&ClientMessage::SetLeftHanded {
device,
left_handed,
})
}
pub fn set_accel_profile(&self, device: InputDevice, profile: AccelProfile) {
self.send(&ClientMessage::SetAccelProfile { device, profile })
}
pub fn set_accel_speed(&self, device: InputDevice, speed: f64) {
self.send(&ClientMessage::SetAccelSpeed { device, speed })
}
pub fn set_transform_matrix(&self, device: InputDevice, matrix: [[f64; 2]; 2]) {
self.send(&ClientMessage::SetTransformMatrix { device, matrix })
}
pub fn has_capability(&self, device: InputDevice, cap: Capability) -> bool {
let res = self.with_response(|| self.send(&ClientMessage::HasCapability { device, cap }));
match res {