1
0
Fork 0
forked from wry/wry

input: add click method and middle button emulation

This commit is contained in:
Stipe Kotarac 2025-05-12 17:52:36 +02:00 committed by Julian Orth
parent 0524e01a3c
commit b20153550e
24 changed files with 598 additions and 21 deletions

View file

@ -2,12 +2,13 @@
pub mod acceleration;
pub mod capability;
pub mod clickmethod;
use {
crate::{
_private::{DEFAULT_SEAT_NAME, ipc::WorkspaceSource},
Axis, Direction, ModifiedKeySym, Workspace,
input::{acceleration::AccelProfile, capability::Capability},
input::{acceleration::AccelProfile, capability::Capability, clickmethod::ClickMethod},
keyboard::{Keymap, mods::Modifiers, syms::KeySym},
video::Connector,
window::Window,
@ -133,6 +134,20 @@ impl InputDevice {
get!().set_input_natural_scrolling_enabled(self, enabled);
}
/// Sets the click method of the device.
///
/// See <https://wayland.freedesktop.org/libinput/doc/latest/configuration.html#click-method>
pub fn set_click_method(self, method: ClickMethod) {
get!().set_input_click_method(self, method);
}
/// Sets whether middle button emulation is enabled for this device.
///
/// See <https://wayland.freedesktop.org/libinput/doc/latest/configuration.html#middle-button-emulation>
pub fn set_middle_button_emulation_enabled(self, enabled: bool) {
get!().set_input_middle_button_emulation_enabled(self, enabled);
}
/// Returns the syspath of this device.
///
/// E.g. `/sys/devices/pci0000:00/0000:00:08.1/0000:14:00.4/usb5/5-1/5-1.1/5-1.1.3/5-1.1.3:1.0`.