River libinput configuration
This protocol exposes libinput device configuration APIs. The libinput documentation should be referred to for detailed information on libinput's behavior.
This protocol is designed so that (hopefully) any backwards compatible change to libinput's API can be matched with a backwards compatible change to this protocol.
Note: the libinput API uses floating point types (float and double in C) which are not (yet?) natively supported by the Wayland protocol. However, the Wayland protocol does support sending arbitrary bytes through the array argument type. This protocol uses e.g. type="array" summary="double" to indicate a native-endian IEEE-754 64-bit double value.
The key words "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may", and "optional" in this document are to be interpreted as described in IETF RFC 2119.
river_libinput_config_v1
Global interface for configuring libinput devices. This global should only be advertised if river_input_manager_v1 is advertised as well.
stop()
This request indicates that the client no longer wishes to receive events on this object.
The Wayland protocol is asynchronous, which means the server may send further events until the stop request is processed. The client must wait for a river_libinput_config_v1.finished event before destroying this object.
destroy()
This request should be called after the finished event has been received to complete destruction of the object.
It is a protocol error to make this request before the finished event has been received.
If a client wishes to destroy this object it should send a river_libinput_config_v1.stop request and wait for a river_libinput_config_v1.finished event. Once the finished event is received it is safe to destroy this object and any other objects created through this interface.
create_accel_config(id: new_id<river_libinput_accel_config_v1>, profile: uint<river_libinput_device_v1.accel_profile>)
Argument | Type | Description |
|---|---|---|
| id | new_id<river_libinput_accel_config_v1> | |
| profile | uint<river_libinput_device_v1.accel_profile> |
Create a acceleration config which can be applied with river_libinput_device_v1.apply_accel_config.
finished()
This event indicates that the server will send no further events on this object. The client should destroy the object. See river_libinput_config_v1.destroy for more information.
libinput_device(id: new_id<river_libinput_device_v1>)
Argument | Type | Description |
|---|---|---|
| id | new_id<river_libinput_device_v1> |
A new libinput device has been created. Not every river_input_device_v1 is necessarily a libinput device as well.
error { invalid_arg, invalid_destroy }
Argument | Value | Description |
|---|---|---|
| invalid_arg | 0 | invalid enum value or similar |
| invalid_destroy | 1 |
river_libinput_device_v1
In general, *_support events will be sent exactly once directly after the river_libinput_device_v1 is created. *_default events will be sent after *_support events if the config option is supported, and *_current events willl be sent after the *_default events and again whenever the config option is changed.
destroy()
This request indicates that the client will no longer use the input device object and that it may be safely destroyed.
set_send_events(result: new_id<river_libinput_result_v1>, mode: uint<river_libinput_device_v1.send_events_modes>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| mode | uint<river_libinput_device_v1.send_events_modes> |
Set the send events mode for the device.
set_tap(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.tap_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.tap_state> |
Configure tap-to-click on this device, with a default mapping of 1, 2, 3 finger tap mapping to left, right, middle click, respectively.
set_tap_button_map(result: new_id<river_libinput_result_v1>, button_map: uint<river_libinput_device_v1.tap_button_map>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| button_map | uint<river_libinput_device_v1.tap_button_map> |
Set the finger number to button number mapping for tap-to-click. The default mapping on most devices is to have a 1, 2 and 3 finger tap to map to the left, right and middle button, respectively.
set_drag(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.drag_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.drag_state> |
Configure tap-and-drag functionality on the device.
set_drag_lock(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.drag_lock_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.drag_lock_state> |
Configure drag-lock during tapping on this device. When enabled, a finger may be lifted and put back on the touchpad and the drag process continues. A timeout for lifting the finger is optional. When disabled, lifting the finger during a tap-and-drag will immediately stop the drag. See the libinput documentation for more details.
set_three_finger_drag(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.three_finger_drag_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.three_finger_drag_state> |
Configure three finger drag functionality for the device.
set_calibration_matrix(result: new_id<river_libinput_result_v1>, matrix: array)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| matrix | array | array of 6 floats |
Set calibration matrix.
set_accel_profile(result: new_id<river_libinput_result_v1>, profile: uint<river_libinput_device_v1.accel_profile>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| profile | uint<river_libinput_device_v1.accel_profile> |
Set the acceleration profile.
set_accel_speed(result: new_id<river_libinput_result_v1>, speed: array)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| speed | array | double |
Set the acceleration speed within a range of [-1, 1], where 0 is the default acceleration for this device, -1 is the slowest acceleration and 1 is the maximum acceleration available on this device.
apply_accel_config(result: new_id<river_libinput_result_v1>, config: object<river_libinput_accel_config_v1>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| config | object<river_libinput_accel_config_v1> |
Apply a pointer accleration config.
set_natural_scroll(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.natural_scroll_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.natural_scroll_state> |
Set natural scroll state.
set_left_handed(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.left_handed_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.left_handed_state> |
Set left-handed mode state.
set_click_method(result: new_id<river_libinput_result_v1>, method: uint<river_libinput_device_v1.click_method>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| method | uint<river_libinput_device_v1.click_method> |
Set click method.
set_clickfinger_button_map(result: new_id<river_libinput_result_v1>, button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| button_map | uint<river_libinput_device_v1.clickfinger_button_map> |
Set clickfinger button map. Supported if click_methods.clickfinger is supported.
set_middle_emulation(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.middle_emulation_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.middle_emulation_state> |
Set middle mouse button emulation state.
set_scroll_method(result: new_id<river_libinput_result_v1>, method: uint<river_libinput_device_v1.scroll_method>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| method | uint<river_libinput_device_v1.scroll_method> |
Set scroll method.
set_scroll_button(result: new_id<river_libinput_result_v1>, button: uint)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| button | uint |
Set scroll button. Supported if scroll_methods.on_button_down is supported.
set_scroll_button_lock(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.scroll_button_lock_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.scroll_button_lock_state> |
Set scroll button lock state. Supported if scroll_methods.on_button_down is supported.
set_dwt(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.dwt_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.dwt_state> |
Set disable-while-typing state.
set_dwtp(result: new_id<river_libinput_result_v1>, state: uint<river_libinput_device_v1.dwtp_state>)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| state | uint<river_libinput_device_v1.dwtp_state> |
Set disable-while-trackpointing state.
set_rotation(result: new_id<river_libinput_result_v1>, angle: uint)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| angle | uint |
Set rotation angle in degrees clockwise off the logical neutral position. Angle must be in the range [0-360).
removed()
This event indicates that the libinput device has been removed.
The server will send no further events on this object and ignore any request (other than river_libinput_device_v1.destroy) made after this event is sent. The client should destroy this object with the river_libinput_device_v1.destroy request to free up resources.
input_device(device: object<river_input_device_v1>)
Argument | Type | Description |
|---|---|---|
| device | object<river_input_device_v1> |
The river_input_device_v1 corresponding to this libinput device. This event will always be the first event sent on the river_libinput_device_v1 object, and it will be sent exactly once.
send_events_support(modes: uint<river_libinput_device_v1.send_events_modes>)
Argument | Type | Description |
|---|---|---|
| modes | uint<river_libinput_device_v1.send_events_modes> |
Supported send events modes.
send_events_default(mode: uint<river_libinput_device_v1.send_events_modes>)
Argument | Type | Description |
|---|---|---|
| mode | uint<river_libinput_device_v1.send_events_modes> |
Default send events mode.
send_events_current(mode: uint<river_libinput_device_v1.send_events_modes>)
Argument | Type | Description |
|---|---|---|
| mode | uint<river_libinput_device_v1.send_events_modes> |
Current send events mode.
tap_support(finger_count: int)
Argument | Type | Description |
|---|---|---|
| finger_count | int |
The number of fingers supported for tap-to-click/drag. If finger_count is 0, tap-to-click and drag are unsupported.
tap_default(state: uint<river_libinput_device_v1.tap_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.tap_state> |
Default tap-to-click state.
tap_current(state: uint<river_libinput_device_v1.tap_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.tap_state> |
Current tap-to-click state.
tap_button_map_default(button_map: uint<river_libinput_device_v1.tap_button_map>)
Argument | Type | Description |
|---|---|---|
| button_map | uint<river_libinput_device_v1.tap_button_map> |
Default tap-to-click button map.
tap_button_map_current(button_map: uint<river_libinput_device_v1.tap_button_map>)
Argument | Type | Description |
|---|---|---|
| button_map | uint<river_libinput_device_v1.tap_button_map> |
Current tap-to-click button map.
drag_default(state: uint<river_libinput_device_v1.drag_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.drag_state> |
Default tap-and-drag state.
drag_current(state: uint<river_libinput_device_v1.drag_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.drag_state> |
Current tap-and-drag state.
drag_lock_default(state: uint<river_libinput_device_v1.drag_lock_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.drag_lock_state> |
Default drag lock state.
drag_lock_current(state: uint<river_libinput_device_v1.drag_lock_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.drag_lock_state> |
Current drag lock state.
three_finger_drag_support(finger_count: int)
Argument | Type | Description |
|---|---|---|
| finger_count | int |
The number of fingers supported for three/four finger drag. If finger_count is less than 3, three finger drag is unsupported.
three_finger_drag_default(state: uint<river_libinput_device_v1.three_finger_drag_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.three_finger_drag_state> |
Default three finger drag state.
three_finger_drag_current(state: uint<river_libinput_device_v1.three_finger_drag_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.three_finger_drag_state> |
Current three finger drag state.
calibration_matrix_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
A calibration matrix is supported if the supported argument is non-zero.
calibration_matrix_default(matrix: array)
Argument | Type | Description |
|---|---|---|
| matrix | array | array of 6 floats |
Default calibration matrix.
calibration_matrix_current(matrix: array)
Argument | Type | Description |
|---|---|---|
| matrix | array | array of 6 floats |
Current calibration matrix.
accel_profiles_support(profiles: uint<river_libinput_device_v1.accel_profiles>)
Argument | Type | Description |
|---|---|---|
| profiles | uint<river_libinput_device_v1.accel_profiles> |
Supported acceleration profiles.
accel_profile_default(profile: uint<river_libinput_device_v1.accel_profile>)
Argument | Type | Description |
|---|---|---|
| profile | uint<river_libinput_device_v1.accel_profile> |
Default acceleration profile.
accel_profile_current(profile: uint<river_libinput_device_v1.accel_profile>)
Argument | Type | Description |
|---|---|---|
| profile | uint<river_libinput_device_v1.accel_profile> |
Current acceleration profile.
accel_speed_default(speed: array)
Argument | Type | Description |
|---|---|---|
| speed | array | double |
Default acceleration speed.
accel_speed_current(speed: array)
Argument | Type | Description |
|---|---|---|
| speed | array | double |
Current acceleration speed.
natural_scroll_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Natural scroll is supported if the supported argument is non-zero.
natural_scroll_default(state: uint<river_libinput_device_v1.natural_scroll_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.natural_scroll_state> |
Default natural scroll.
natural_scroll_current(state: uint<river_libinput_device_v1.natural_scroll_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.natural_scroll_state> |
Current natural scroll.
left_handed_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Left-handed mode is supported if the supported argument is non-zero.
left_handed_default(state: uint<river_libinput_device_v1.left_handed_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.left_handed_state> |
Default left-handed mode.
left_handed_current(state: uint<river_libinput_device_v1.left_handed_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.left_handed_state> |
Current left-handed mode.
click_method_support(methods: uint<river_libinput_device_v1.click_methods>)
Argument | Type | Description |
|---|---|---|
| methods | uint<river_libinput_device_v1.click_methods> |
The click methods supported by the device.
click_method_default(method: uint<river_libinput_device_v1.click_method>)
Argument | Type | Description |
|---|---|---|
| method | uint<river_libinput_device_v1.click_method> |
Default click method.
click_method_current(method: uint<river_libinput_device_v1.click_method>)
Argument | Type | Description |
|---|---|---|
| method | uint<river_libinput_device_v1.click_method> |
Current click method.
clickfinger_button_map_default(button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
Argument | Type | Description |
|---|---|---|
| button_map | uint<river_libinput_device_v1.clickfinger_button_map> |
Default clickfinger button map. Supported if click_methods.clickfinger is supported.
clickfinger_button_map_current(button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
Argument | Type | Description |
|---|---|---|
| button_map | uint<river_libinput_device_v1.clickfinger_button_map> |
Current clickfinger button map. Supported if click_methods.clickfinger is supported.
middle_emulation_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Middle mouse button emulation is supported if the supported argument is non-zero.
middle_emulation_default(state: uint<river_libinput_device_v1.middle_emulation_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.middle_emulation_state> |
Default middle mouse button emulation.
middle_emulation_current(state: uint<river_libinput_device_v1.middle_emulation_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.middle_emulation_state> |
Current middle mouse button emulation.
scroll_method_support(methods: uint<river_libinput_device_v1.scroll_methods>)
Argument | Type | Description |
|---|---|---|
| methods | uint<river_libinput_device_v1.scroll_methods> |
The scroll methods supported by the device.
scroll_method_default(method: uint<river_libinput_device_v1.scroll_method>)
Argument | Type | Description |
|---|---|---|
| method | uint<river_libinput_device_v1.scroll_method> |
Default scroll method.
scroll_method_current(method: uint<river_libinput_device_v1.scroll_method>)
Argument | Type | Description |
|---|---|---|
| method | uint<river_libinput_device_v1.scroll_method> |
Current scroll method.
scroll_button_default(button: uint)
Argument | Type | Description |
|---|---|---|
| button | uint |
Default scroll button. Supported if scroll_methods.on_button_down is supported.
scroll_button_current(button: uint)
Argument | Type | Description |
|---|---|---|
| button | uint |
Current scroll button. Supported if scroll_methods.on_button_down is supported.
scroll_button_lock_default(state: uint<river_libinput_device_v1.scroll_button_lock_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.scroll_button_lock_state> |
Default scroll button lock state. Supported if scroll_methods.on_button_down is supported.
scroll_button_lock_current(state: uint<river_libinput_device_v1.scroll_button_lock_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.scroll_button_lock_state> |
Current scroll button lock state. Supported if scroll_methods.on_button_down is supported.
dwt_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Disable-while-typing is supported if the supported argument is non-zero.
dwt_default(state: uint<river_libinput_device_v1.dwt_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.dwt_state> |
Default disable-while-typing state.
dwt_current(state: uint<river_libinput_device_v1.dwt_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.dwt_state> |
Current disable-while-typing state.
dwtp_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Disable-while-trackpointing is supported if the supported argument is non-zero.
dwtp_default(state: uint<river_libinput_device_v1.dwtp_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.dwtp_state> |
Default disable-while-trackpointing state.
dwtp_current(state: uint<river_libinput_device_v1.dwtp_state>)
Argument | Type | Description |
|---|---|---|
| state | uint<river_libinput_device_v1.dwtp_state> |
Current disable-while-trackpointing state.
rotation_support(supported: int)
Argument | Type | Description |
|---|---|---|
| supported | int | boolean |
Rotation is supported if the supported argument is non-zero.
rotation_default(angle: uint)
Argument | Type | Description |
|---|---|---|
| angle | uint |
Default rotation angle.
rotation_current(angle: uint)
Argument | Type | Description |
|---|---|---|
| angle | uint |
Current rotation angle.
error { invalid_arg }
Argument | Value | Description |
|---|---|---|
| invalid_arg | 0 | invalid enum value or similar |
send_events_modes { enabled, disabled, disabled_on_external_mouse }
Argument | Value | Description |
|---|---|---|
| enabled | 0 | |
| disabled | 1 | |
| disabled_on_external_mouse | 2 |
drag_lock_state { disabled, enabled_timeout, enabled_sticky }
Argument | Value | Description |
|---|---|---|
| disabled | 0 | |
| enabled_timeout | 1 | |
| enabled_sticky | 2 |
three_finger_drag_state { disabled, enabled_3fg, enabled_4fg }
Argument | Value | Description |
|---|---|---|
| disabled | 0 | |
| enabled_3fg | 1 | |
| enabled_4fg | 2 |
click_method { none, button_areas, clickfinger }
Argument | Value | Description |
|---|---|---|
| none | 0 | |
| button_areas | 1 | |
| clickfinger | 2 |
click_methods { none, button_areas, clickfinger }
Argument | Value | Description |
|---|---|---|
| none | 0 | |
| button_areas | 1 | |
| clickfinger | 2 |
scroll_method { no_scroll, two_finger, edge, on_button_down }
Argument | Value | Description |
|---|---|---|
| no_scroll | 0 | |
| two_finger | 1 | |
| edge | 2 | |
| on_button_down | 4 |
scroll_methods { no_scroll, two_finger, edge, on_button_down }
Argument | Value | Description |
|---|---|---|
| no_scroll | 0 | |
| two_finger | 1 | |
| edge | 2 | |
| on_button_down | 4 |
river_libinput_accel_config_v1
The result returned by libinput on setting configuration for a device.
destroy()
This request indicates that the client will no longer use the accel config object and that it may be safely destroyed.
set_points(result: new_id<river_libinput_result_v1>, type: uint<river_libinput_accel_config_v1.accel_type>, step: array, points: array)
Argument | Type | Description |
|---|---|---|
| result | new_id<river_libinput_result_v1> | |
| type | uint<river_libinput_accel_config_v1.accel_type> | |
| step | array | double |
| points | array | array of doubles |
Defines the acceleration function for a given movement type in an acceleration configuration with custom accel profile.
error { invalid_arg }
Argument | Value | Description |
|---|---|---|
| invalid_arg | 0 | invalid enum value or similar |
river_libinput_result_v1
The result returned by libinput on setting configuration for a device.
success()
The configuration was successfully applied to the device.
unsupported()
The configuration is unsupported by the device and was ignored.
invalid()
The configuration is invalid and was ignored.
Compositor Support
Copyright
SPDX-FileCopyrightText: © 2025 Isaac Freund SPDX-License-Identifier: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.