River libinput configuration

configure libinput devices

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.

libinput config global interface

Global interface for configuring libinput devices. This global should only be advertised if river_input_manager_v1 is advertised as well.

stop()
stop sending events

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()
destroy the river_libinput_config_v1 object

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 a acceleration config

Create a acceleration config which can be applied with river_libinput_device_v1.apply_accel_config.

finished()
the server has finished with the object

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
idnew_id<river_libinput_device_v1>
new libinput device

A new libinput device has been created. Not every river_input_device_v1 is necessarily a libinput device as well.

Argument
Value
Description
invalid_arg0
invalid enum value or similar
invalid_destroy1

a libinput device

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()
destroy the libinput device object

This request indicates that the client will no longer use the input device object and that it may be safely destroyed.

set send events mode

Set the send events mode for the device.

enable/disable tap-to-click

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-to-click 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 tap-and-drag state

Configure tap-and-drag functionality on the device.

set 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 state

Configure three finger drag functionality for the device.

set_calibration_matrix(result: new_id<river_libinput_result_v1>, matrix: array)
Argument
Type
Description
resultnew_id<river_libinput_result_v1>
matrixarray
array of 6 floats
set calibration matrix

Set calibration matrix.

set_accel_speed(result: new_id<river_libinput_result_v1>, speed: array)
Argument
Type
Description
resultnew_id<river_libinput_result_v1>
speedarray
double
set acceleration speed

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 acceleration config

Apply a pointer accleration config.

set clickfinger button map

Set clickfinger button map. Supported if click_methods.clickfinger is supported.

set middle mouse button emulation state

Set middle mouse button emulation state.

set_scroll_button(result: new_id<river_libinput_result_v1>, button: uint)
Argument
Type
Description
resultnew_id<river_libinput_result_v1>
buttonuint
set scroll button

Set scroll button. Supported if scroll_methods.on_button_down is supported.

set scroll button lock state

Set scroll button lock state. Supported if scroll_methods.on_button_down is supported.

set disable-while-typing state

Set disable-while-typing state.

set disable-while-trackpointing state

Set disable-while-trackpointing state.

set_rotation(result: new_id<river_libinput_result_v1>, angle: uint)
Argument
Type
Description
resultnew_id<river_libinput_result_v1>
angleuint
set rotation angle

Set rotation angle in degrees clockwise off the logical neutral position. Angle must be in the range [0-360).

removed()
the libinput device is 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
deviceobject<river_input_device_v1>
corresponding river input device

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.

supported send events modes

Supported send events modes.

default send events mode

Default send events mode.

current send events mode

Current send events mode.

tap_support(finger_count: int)
Argument
Type
Description
finger_countint
tap-to-click/drag support

The number of fingers supported for tap-to-click/drag. If finger_count is 0, tap-to-click and drag are unsupported.

Argument
Type
Description
stateuint<river_libinput_device_v1.tap_state>
default tap-to-click state

Default tap-to-click state.

Argument
Type
Description
stateuint<river_libinput_device_v1.tap_state>
current tap-to-click state

Current tap-to-click state.

default tap-to-click button map

Default tap-to-click button map.

current tap-to-click button map

Current tap-to-click button map.

Argument
Type
Description
stateuint<river_libinput_device_v1.drag_state>
default tap-and-drag state

Default tap-and-drag state.

Argument
Type
Description
stateuint<river_libinput_device_v1.drag_state>
current tap-and-drag state

Current tap-and-drag state.

default drag lock state

Default drag lock state.

current drag lock state

Current drag lock state.

three_finger_drag_support(finger_count: int)
Argument
Type
Description
finger_countint
three finger drag support

The number of fingers supported for three/four finger drag. If finger_count is less than 3, three finger drag is unsupported.

default three finger drag state

Default three finger drag state.

current three finger drag state

Current three finger drag state.

calibration_matrix_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for a calibration matrix

A calibration matrix is supported if the supported argument is non-zero.

calibration_matrix_default(matrix: array)
Argument
Type
Description
matrixarray
array of 6 floats
default calibration matrix

Default calibration matrix.

calibration_matrix_current(matrix: array)
Argument
Type
Description
matrixarray
array of 6 floats
current calibration matrix

Current calibration matrix.

accel_profiles_support(profiles: uint<river_libinput_device_v1.accel_profiles>)
supported acceleration profiles

Supported acceleration profiles.

accel_profile_default(profile: uint<river_libinput_device_v1.accel_profile>)
default acceleration profile

Default acceleration profile.

accel_profile_current(profile: uint<river_libinput_device_v1.accel_profile>)
current send events mode

Current acceleration profile.

accel_speed_default(speed: array)
Argument
Type
Description
speedarray
double
default acceleration speed

Default acceleration speed.

accel_speed_current(speed: array)
Argument
Type
Description
speedarray
double
current acceleration speed

Current acceleration speed.

natural_scroll_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for natural scroll

Natural scroll is supported if the supported argument is non-zero.

default natural scroll

Default natural scroll.

current natural scroll state

Current natural scroll.

left_handed_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for left-handed mode

Left-handed mode is supported if the supported argument is non-zero.

default left-handed mode

Default left-handed mode.

current left-handed mode state

Current left-handed mode.

click_method_support(methods: uint<river_libinput_device_v1.click_methods>)
supported click methods

The click methods supported by the device.

click_method_default(method: uint<river_libinput_device_v1.click_method>)
Argument
Type
Description
methoduint<river_libinput_device_v1.click_method>
default click method

Default click method.

click_method_current(method: uint<river_libinput_device_v1.click_method>)
Argument
Type
Description
methoduint<river_libinput_device_v1.click_method>
current click method

Current click method.

clickfinger_button_map_default(button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
default 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>)
current clickfinger button map

Current clickfinger button map. Supported if click_methods.clickfinger is supported.

middle_emulation_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for middle mouse button emulation

Middle mouse button emulation is supported if the supported argument is non-zero.

default middle mouse button emulation

Default middle mouse button emulation.

current middle mouse button emulation state

Current middle mouse button emulation.

scroll_method_support(methods: uint<river_libinput_device_v1.scroll_methods>)
supported scroll methods

The scroll methods supported by the device.

scroll_method_default(method: uint<river_libinput_device_v1.scroll_method>)
default scroll method

Default scroll method.

scroll_method_current(method: uint<river_libinput_device_v1.scroll_method>)
current scroll method

Current scroll method.

scroll_button_default(button: uint)
Argument
Type
Description
buttonuint
default scroll button

Default scroll button. Supported if scroll_methods.on_button_down is supported.

scroll_button_current(button: uint)
Argument
Type
Description
buttonuint
current scroll button

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>)
default 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>)
current 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
supportedint
boolean
support for disable-while-typing

Disable-while-typing is supported if the supported argument is non-zero.

Argument
Type
Description
stateuint<river_libinput_device_v1.dwt_state>
default disable-while-typing state

Default disable-while-typing state.

Argument
Type
Description
stateuint<river_libinput_device_v1.dwt_state>
current disable-while-typing state

Current disable-while-typing state.

dwtp_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for disable-while-trackpointing

Disable-while-trackpointing is supported if the supported argument is non-zero.

Argument
Type
Description
stateuint<river_libinput_device_v1.dwtp_state>
default disable-while-trackpointing state

Default disable-while-trackpointing state.

Argument
Type
Description
stateuint<river_libinput_device_v1.dwtp_state>
current disable-while-trackpointing state

Current disable-while-trackpointing state.

rotation_support(supported: int)
Argument
Type
Description
supportedint
boolean
support for rotation

Rotation is supported if the supported argument is non-zero.

rotation_default(angle: uint)
Argument
Type
Description
angleuint
default rotation angle

Default rotation angle.

rotation_current(angle: uint)
Argument
Type
Description
angleuint
current rotation angle

Current rotation angle.

error { invalid_arg } 
Argument
Value
Description
invalid_arg0
invalid enum value or similar
tap_button_map { lrm, lmr } 
Argument
Value
Description
lrm0
1/2/3 finger tap maps to left/right/middle
lmr1
1/2/3 finger tap maps to left/middle/right
drag_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1
accel_profiles { none, flat, adaptive, custom } 
Argument
Value
Description
none0
flat1
adaptive2
custom4
natural_scroll_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1
left_handed_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1
clickfinger_button_map { lrm, lmr } 
Argument
Value
Description
lrm0
lmr1
middle_emulation_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1
scroll_button_lock_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1
dwtp_state { disabled, enabled } 
Argument
Value
Description
disabled0
enabled1

acceleration config

The result returned by libinput on setting configuration for a device.

destroy()
destroy the accel object

This request indicates that the client will no longer use the accel config object and that it may be safely destroyed.

Argument
Type
Description
resultnew_id<river_libinput_result_v1>
typeuint<river_libinput_accel_config_v1.accel_type>
steparray
double
pointsarray
array of doubles
define custom acceleration function

Defines the acceleration function for a given movement type in an acceleration configuration with custom accel profile.

error { invalid_arg } 
Argument
Value
Description
invalid_arg0
invalid enum value or similar

config application result

The result returned by libinput on setting configuration for a device.

success()
config success

The configuration was successfully applied to the device.

unsupported()
config unsupported

The configuration is unsupported by the device and was ignored.

invalid()
config invalid

The configuration is invalid and was ignored.


Compositor Support

No compositor support found

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.