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

@ -16,7 +16,7 @@ use {
exec::Command,
input::{
FocusFollowsMouseMode, InputDevice, Seat, SwitchEvent, acceleration::AccelProfile,
capability::Capability,
capability::Capability, clickmethod::ClickMethod,
},
keyboard::{
Keymap,
@ -1174,6 +1174,14 @@ impl ConfigClient {
self.send(&ClientMessage::SetDragLockEnabled { device, enabled })
}
pub fn set_input_click_method(&self, device: InputDevice, method: ClickMethod) {
self.send(&ClientMessage::SetClickMethod { device, method })
}
pub fn set_input_middle_button_emulation_enabled(&self, device: InputDevice, enabled: bool) {
self.send(&ClientMessage::SetMiddleButtonEmulationEnabled { device, enabled })
}
pub fn device_name(&self, device: InputDevice) -> String {
let res = self.send_with_response(&ClientMessage::GetDeviceName { device });
get_response!(res, String::new(), GetDeviceName { name });

View file

@ -5,7 +5,7 @@ use {
client::{Client, ClientMatcher},
input::{
FocusFollowsMouseMode, InputDevice, Seat, SwitchEvent, acceleration::AccelProfile,
capability::Capability,
capability::Capability, clickmethod::ClickMethod,
},
keyboard::{Keymap, mods::Modifiers, syms::KeySym},
logging::LogLevel,
@ -710,6 +710,14 @@ pub enum ClientMessage<'a> {
seat: Seat,
key: KeySym,
},
SetClickMethod {
device: InputDevice,
method: ClickMethod,
},
SetMiddleButtonEmulationEnabled {
device: InputDevice,
enabled: bool,
},
}
#[derive(Serialize, Deserialize, Debug)]