input: add touchpad `drag-lock` setting
Browse files at this commit900da597e4d3d09ad4c4ddc3ba2abf58c4886ec9Parent: d3208334 changed files +7 -0
- niri-config/src/lib.rs +3 -0
- resources/default-config.kdl +1 -0
- src/input/mod.rs +1 -0
- wiki/Configuration:-Input.md +2 -0
niri-config/src/lib.rsmodified+3 -0
| @@ -184,6 +184,8 @@ pub struct Touchpad { | |||
| 184 | #[knuffel(child)] | 184 | #[knuffel(child)] |
| 185 | pub dwtp: bool, | 185 | pub dwtp: bool, |
| 186 | #[knuffel(child)] | 186 | #[knuffel(child)] |
| 187 | + pub drag_lock: bool, | ||
| 188 | + #[knuffel(child)] | ||
| 187 | pub natural_scroll: bool, | 189 | pub natural_scroll: bool, |
| 188 | #[knuffel(child, unwrap(argument, str))] | 190 | #[knuffel(child, unwrap(argument, str))] |
| 189 | pub click_method: Option<ClickMethod>, | 191 | pub click_method: Option<ClickMethod>, |
| @@ -3600,6 +3602,7 @@ mod tests { | |||
| 3600 | tap: true, | 3602 | tap: true, |
| 3601 | dwt: true, | 3603 | dwt: true, |
| 3602 | dwtp: true, | 3604 | dwtp: true, |
| 3605 | + drag_lock: false, | ||
| 3603 | click_method: Some(ClickMethod::Clickfinger), | 3606 | click_method: Some(ClickMethod::Clickfinger), |
| 3604 | natural_scroll: false, | 3607 | natural_scroll: false, |
| 3605 | accel_speed: 0.2, | 3608 | accel_speed: 0.2, |
resources/default-config.kdlmodified+1 -0
| @@ -25,6 +25,7 @@ input { | |||
| 25 | tap | 25 | tap |
| 26 | // dwt | 26 | // dwt |
| 27 | // dwtp | 27 | // dwtp |
| 28 | + // drag-lock | ||
| 28 | natural-scroll | 29 | natural-scroll |
| 29 | // accel-speed 0.2 | 30 | // accel-speed 0.2 |
| 30 | // accel-profile "flat" | 31 | // accel-profile "flat" |
src/input/mod.rsmodified+1 -0
| @@ -3218,6 +3218,7 @@ pub fn apply_libinput_settings(config: &niri_config::Input, device: &mut input:: | |||
| 3218 | let _ = device.config_tap_set_enabled(c.tap); | 3218 | let _ = device.config_tap_set_enabled(c.tap); |
| 3219 | let _ = device.config_dwt_set_enabled(c.dwt); | 3219 | let _ = device.config_dwt_set_enabled(c.dwt); |
| 3220 | let _ = device.config_dwtp_set_enabled(c.dwtp); | 3220 | let _ = device.config_dwtp_set_enabled(c.dwtp); |
| 3221 | + let _ = device.config_tap_set_drag_lock_enabled(c.drag_lock); | ||
| 3221 | let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll); | 3222 | let _ = device.config_scroll_set_natural_scroll_enabled(c.natural_scroll); |
| 3222 | let _ = device.config_accel_set_speed(c.accel_speed); | 3223 | let _ = device.config_accel_set_speed(c.accel_speed); |
| 3223 | let _ = device.config_left_handed_set(c.left_handed); | 3224 | let _ = device.config_left_handed_set(c.left_handed); |
wiki/Configuration:-Input.mdmodified+2 -0
| @@ -30,6 +30,7 @@ input { | |||
| 30 | tap | 30 | tap |
| 31 | // dwt | 31 | // dwt |
| 32 | // dwtp | 32 | // dwtp |
| 33 | + // drag-lock | ||
| 33 | natural-scroll | 34 | natural-scroll |
| 34 | // accel-speed 0.2 | 35 | // accel-speed 0.2 |
| 35 | // accel-profile "flat" | 36 | // accel-profile "flat" |
| @@ -181,6 +182,7 @@ Settings specific to `touchpad`s: | |||
| 181 | - `tap`: tap-to-click. | 182 | - `tap`: tap-to-click. |
| 182 | - `dwt`: disable-when-typing. | 183 | - `dwt`: disable-when-typing. |
| 183 | - `dwtp`: disable-when-trackpointing. | 184 | - `dwtp`: disable-when-trackpointing. |
| 185 | +- `drag-lock`: if set, lifting the finger off for a short time while dragging will not drop the dragged item. See the [libinput documentation](https://wayland.freedesktop.org/libinput/doc/latest/tapping.html#tap-and-drag). | ||
| 184 | - `tap-button-map`: can be `left-right-middle` or `left-middle-right`, controls which button corresponds to a two-finger tap and a three-finger tap. | 186 | - `tap-button-map`: can be `left-right-middle` or `left-middle-right`, controls which button corresponds to a two-finger tap and a three-finger tap. |
| 185 | - `click-method`: can be `button-areas` or `clickfinger`, changes the [click method](https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html). | 187 | - `click-method`: can be `button-areas` or `clickfinger`, changes the [click method](https://wayland.freedesktop.org/libinput/doc/latest/clickpad-softbuttons.html). |
| 186 | - `disabled-on-external-mouse`: do not send events while external pointer device is plugged in. | 188 | - `disabled-on-external-mouse`: do not send events while external pointer device is plugged in. |