mirror of
https://github.com/swaywm/sway.git
synced 2026-03-07 04:34:20 -05:00
Implement clickfinger_button_map support.
This commit is contained in:
parent
818ea17389
commit
5be5a50051
10 changed files with 74 additions and 3 deletions
|
|
@ -132,6 +132,16 @@ static bool set_click_method(struct libinput_device *device,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool set_clickfinger_button_map(struct libinput_device *device,
|
||||
enum libinput_config_clickfinger_button_map map) {
|
||||
if (libinput_device_config_click_get_clickfinger_button_map(device) == map) {
|
||||
return false;
|
||||
}
|
||||
sway_log(SWAY_DEBUG, "clickfinger_set_button_map(%d)", map);
|
||||
log_status(libinput_device_config_click_set_clickfinger_button_map(device, map));
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool set_middle_emulation(struct libinput_device *dev,
|
||||
enum libinput_config_middle_emulation_state mid) {
|
||||
if (!libinput_device_config_middle_emulation_is_available(dev) ||
|
||||
|
|
@ -281,6 +291,9 @@ bool sway_input_configure_libinput_device(struct sway_input_device *input_device
|
|||
if (ic->click_method != INT_MIN) {
|
||||
changed |= set_click_method(device, ic->click_method);
|
||||
}
|
||||
if (ic->clickfinger_button_map != INT_MIN) {
|
||||
changed |= set_clickfinger_button_map(device, ic->clickfinger_button_map);
|
||||
}
|
||||
if (ic->middle_emulation != INT_MIN) {
|
||||
changed |= set_middle_emulation(device, ic->middle_emulation);
|
||||
}
|
||||
|
|
@ -356,6 +369,8 @@ void sway_input_reset_libinput_device(struct sway_input_device *input_device) {
|
|||
libinput_device_config_left_handed_get_default(device));
|
||||
changed |= set_click_method(device,
|
||||
libinput_device_config_click_get_default_method(device));
|
||||
changed |= set_clickfinger_button_map(device,
|
||||
libinput_device_config_click_get_default_clickfinger_button_map(device));
|
||||
changed |= set_middle_emulation(device,
|
||||
libinput_device_config_middle_emulation_get_default_enabled(device));
|
||||
changed |= set_scroll_method(device,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue