input: support scroll button lock config

This commit is contained in:
Aviva Ruben
2024-10-01 14:48:27 -05:00
committed by Isaac Freund
parent 26f599b56b
commit fd55f51ba1
5 changed files with 24 additions and 2 deletions

View File

@ -215,6 +215,18 @@ pub const ScrollButton = struct {
}
};
pub const ScrollButtonLock = enum {
enabled,
disabled,
fn apply(scroll_button_lock: ScrollButtonLock, device: *c.libinput_device) void {
_ = c.libinput_device_config_scroll_set_button_lock(device, switch (scroll_button_lock) {
.enabled => c.LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED,
.disabled => c.LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED,
});
}
};
pub const MapToOutput = struct {
output_name: ?[]const u8,
@ -279,6 +291,7 @@ tap: ?TapState = null,
@"pointer-accel": ?PointerAccel = null,
@"scroll-method": ?ScrollMethod = null,
@"scroll-button": ?ScrollButton = null,
@"scroll-button-lock": ?ScrollButtonLock = null,
@"map-to-output": ?MapToOutput = null,
pub fn deinit(config: *InputConfig) void {