1
0
Fork 0
forked from wry/wry

wayland: implement wl_touch

Co-authored-by: Julian Orth <ju.orth@gmail.com>
This commit is contained in:
Amine Hassane 2024-04-21 14:48:26 +01:00 committed by Julian Orth
parent 905e2dd7ba
commit 681c1ad033
35 changed files with 1071 additions and 52 deletions

View file

@ -897,6 +897,10 @@ impl Client {
self.send(&ClientMessage::SetTransformMatrix { device, matrix })
}
pub fn set_calibration_matrix(&self, device: InputDevice, matrix: [[f32; 3]; 2]) {
self.send(&ClientMessage::SetCalibrationMatrix { device, matrix })
}
pub fn set_px_per_wheel_scroll(&self, device: InputDevice, px: f64) {
self.send(&ClientMessage::SetPxPerWheelScroll { device, px })
}

View file

@ -502,6 +502,10 @@ pub enum ClientMessage<'a> {
connector: Option<Connector>,
mode: TearingMode,
},
SetCalibrationMatrix {
device: InputDevice,
matrix: [[f32; 3]; 2],
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -80,6 +80,13 @@ impl InputDevice {
get!().set_transform_matrix(self, matrix);
}
/// Sets the calibration matrix of the device.
///
/// This corresponds to the libinput setting of the same name.
pub fn set_calibration_matrix(self, matrix: [[f32; 3]; 2]) {
get!().set_calibration_matrix(self, matrix);
}
/// Returns the name of the device.
pub fn name(self) -> String {
get!(String::new()).device_name(self)