River libinput configuration

配置 libinput 设备

该协议暴露了 libinput 设备配置 API。有关 libinput 的 行为详细信息,应参考 libinput 文档。

设计此协议的目的是为了(希望)任何向后兼容的 libinput API 更改都可以与本协议的向后兼容更改相匹配。

注意:libinput API 使用浮点类型(C 语言中的 float 和 double), Wayland 协议目前(尚未?)原生支持这些类型。但是, Wayland 协议支持通过数组(array)参数类型发送任意字节。 该协议使用例如 type="array" summary="double" 来 表示原生字节序的 IEEE-754 64 位 double 值。

本文档中的关键字“must”、“must not”、“required”、“shall”、“shall not”、 “should”、“should not”、“recommended”、“may”和“optional”应按 IETF RFC 2119 中描述的方式解释。

libinput 配置全局接口

用于配置 libinput 设备的全局接口。仅当同时也广播了 river_input_manager_v1 时,才应广播此全局对象。

stop()
停止发送事件

此请求表明客户端不愿再在此对象上 接收事件。

Wayland 协议是异步的,这意味着在处理完 stop 请求之前, 服务端可能会继续发送事件。客户端必须等待 river_libinput_config_v1.finished 事件才能销毁 该对象。

destroy()
销毁 river_libinput_config_v1 对象

在接收到 finished 事件后应调用此请求 以完成对象的销毁。

在接收到 finished 事件之前发出此请求属于协议错误。

如果客户端希望销毁此对象,它应发送 river_libinput_config_v1.stop 请求并等待 river_libinput_config_v1.finished 事件。一旦接收到 finished 事件, 即可安全销毁此对象以及通过此接口创建的任何其他对象。

创建加速配置

创建可通过 river_libinput_device_v1.apply_accel_config 应用的加速配置。

finished()
服务端已处理完该对象

此事件表明服务端将不再在此对象上发送进一步的事件。 客户端应销毁该对象。详情请参阅 river_libinput_config_v1.destroy。

libinput_device(id: new_id<river_libinput_device_v1>)
参数
类型
描述
idnew_id<river_libinput_device_v1>
新的 libinput 设备

已创建新的 libinput 设备。并非每个 river_input_device_v1 都必定是 libinput 设备。

参数
描述
invalid_arg0
无效的枚举值或类似参数
invalid_destroy1

libinput 设备

通常,*_support 事件将在 river_libinput_device_v1 创建后立即发送一次。如果支持该配置选项,*_default 事件将在 *_support 事件之后发送,*_current 事件将在 *_default 事件之后发送,并在配置选项更改时再次发送。

destroy()
销毁 libinput 设备对象

此请求表明客户端将不再使用该输入 设备对象,可以安全地销毁它。

设置发送事件模式

设置设备的发送事件模式。

启用/禁用轻触点击

在该设备上配置轻触点击,默认将 1、2、3 指轻触分别映射为左键、右键和中键点击。

设置轻触点击按钮映射

设置轻触点击的手指数量到按钮编号的映射。 大多数设备上的默认映射是将 1、2 和 3 指轻触 分别映射为左、右和中键。

设置轻触拖拽状态

在设备上配置轻触拖拽功能。

设置拖拽锁定状态

配置设备上的轻触期间拖拽锁定。启用时, 手指可以抬起并放回触摸板上以继续拖拽过程。 抬起手指的超时可选。禁用时, 在轻触拖拽期间抬起手指会立即停止拖拽。 详情请参阅 libinput 文档。

set_calibration_matrix(result: new_id<river_libinput_result_v1>, matrix: array)
参数
类型
描述
resultnew_id<river_libinput_result_v1>
matrixarray
array of 6 floats
设置校准矩阵

设置校准矩阵。

set_accel_speed(result: new_id<river_libinput_result_v1>, speed: array)
参数
类型
描述
resultnew_id<river_libinput_result_v1>
speedarray
double
设置加速速度

在 [-1, 1] 范围内设置加速速度,其中 0 是 此设备的默认加速,-1 是最慢的加速, 而 1 是此设备上可用的最大加速。

应用加速配置

应用指针加速配置。

设置 clickfinger 按钮映射

设置 clickfinger 按钮映射。 如果支持 click_methods.clickfinger 则受支持。

set_scroll_button(result: new_id<river_libinput_result_v1>, button: uint)
参数
类型
描述
resultnew_id<river_libinput_result_v1>
buttonuint
设置滚动按钮

设置滚动按钮。 如果支持 scroll_methods.on_button_down 则受支持。

设置滚动按钮锁定状态

设置滚动按钮锁定状态。 如果支持 scroll_methods.on_button_down 则受支持。

设置打字时禁用状态

设置打字时禁用状态。

设置使用指点杆时禁用状态

设置使用指点杆时禁用状态。

set_rotation(result: new_id<river_libinput_result_v1>, angle: uint)
参数
类型
描述
resultnew_id<river_libinput_result_v1>
angleuint
设置旋转角度

设置偏离逻辑中性位置的顺时针旋转角度(度)。 角度必须在 [0-360) 范围内。

removed()
libinput 设备已移除

此事件表示 libinput 设备已被移除。

服务端将不再在此对象上发送进一步的事件,并忽略在发送此事件后 发出的任何请求(river_libinput_device_v1.destroy 除外)。 客户端应使用 river_libinput_device_v1.destroy 请求销毁此对象以释放资源。

input_device(device: object<river_input_device_v1>)
参数
类型
描述
deviceobject<river_input_device_v1>
对应的 river 输入设备

对应此 libinput 设备的 river_input_device_v1。 此事件将始终是 river_libinput_device_v1 对象上 发送的第一个事件,并且只发送一次。

支持的发送事件模式

支持的发送事件模式。

默认发送事件模式

默认发送事件模式。

当前发送事件模式

当前发送事件模式。

tap_support(finger_count: int)
参数
类型
描述
finger_countint
支持轻触点击/拖拽

支持轻触点击/拖拽的手指数量。 如果 finger_count 为 0,则不支持轻触点击和拖拽。

默认轻触点击状态

默认轻触点击状态。

当前轻触点击状态

当前轻触点击状态。

默认轻触点击按钮映射

默认轻触点击按钮映射。

当前轻触点击按钮映射

当前轻触点击按钮映射。

默认轻触拖拽状态

默认轻触拖拽状态。

当前轻触拖拽状态

当前轻触拖拽状态。

默认拖拽锁定状态

默认拖拽锁定状态。

当前拖拽锁定状态

当前拖拽锁定状态。

three_finger_drag_support(finger_count: int)
参数
类型
描述
finger_countint
支持三指拖拽

支持三/四指拖拽的手指数量。 如果 finger_count 小于 3,则不支持三指拖拽。

默认三指拖拽状态

默认三指拖拽状态。

当前三指拖拽状态

当前三指拖拽状态。

calibration_matrix_support(supported: int)
参数
类型
描述
supportedint
boolean
支持校准矩阵

如果 supported 参数非零,则支持校准矩阵。

calibration_matrix_default(matrix: array)
参数
类型
描述
matrixarray
array of 6 floats
默认校准矩阵

默认校准矩阵。

calibration_matrix_current(matrix: array)
参数
类型
描述
matrixarray
array of 6 floats
当前校准矩阵

当前校准矩阵。

accel_profiles_support(profiles: uint<river_libinput_device_v1.accel_profiles>)
支持的加速配置文件

支持的加速配置文件。

accel_profile_default(profile: uint<river_libinput_device_v1.accel_profile>)
默认加速配置文件

默认加速配置文件。

accel_profile_current(profile: uint<river_libinput_device_v1.accel_profile>)
当前发送事件模式

当前加速配置文件。

accel_speed_default(speed: array)
参数
类型
描述
speedarray
double
默认加速速度

默认加速速度。

accel_speed_current(speed: array)
参数
类型
描述
speedarray
double
当前加速速度

当前加速速度。

natural_scroll_support(supported: int)
参数
类型
描述
supportedint
boolean
支持自然滚动

如果 supported 参数非零,则支持自然滚动。

当前自然滚动状态

当前自然滚动。

left_handed_support(supported: int)
参数
类型
描述
supportedint
boolean
支持左手模式

如果 supported 参数非零,则支持左手模式。

当前左手模式状态

当前左手模式。

click_method_support(methods: uint<river_libinput_device_v1.click_methods>)
支持的点击方法

设备支持的点击方法。

click_method_default(method: uint<river_libinput_device_v1.click_method>)
默认点击方法

默认点击方法。

click_method_current(method: uint<river_libinput_device_v1.click_method>)
当前点击方法

当前点击方法。

clickfinger_button_map_default(button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
默认 clickfinger 按钮映射

默认 clickfinger 按钮映射。 如果支持 click_methods.clickfinger 则受支持。

clickfinger_button_map_current(button_map: uint<river_libinput_device_v1.clickfinger_button_map>)
当前 clickfinger 按钮映射

当前 clickfinger 按钮映射。 如果支持 click_methods.clickfinger 则受支持。

middle_emulation_support(supported: int)
参数
类型
描述
supportedint
boolean
支持中键模拟

如果 supported 参数非零,则支持中键模拟。

当前中键模拟状态

当前中键模拟。

scroll_method_support(methods: uint<river_libinput_device_v1.scroll_methods>)
支持的滚动方法

设备支持的滚动方法。

scroll_method_default(method: uint<river_libinput_device_v1.scroll_method>)
默认滚动方法

默认滚动方法。

scroll_method_current(method: uint<river_libinput_device_v1.scroll_method>)
当前滚动方法

当前滚动方法。

scroll_button_default(button: uint)
参数
类型
描述
buttonuint
默认滚动按钮

默认滚动按钮。 如果支持 scroll_methods.on_button_down 则受支持。

scroll_button_current(button: uint)
参数
类型
描述
buttonuint
当前滚动按钮

当前滚动按钮。 如果支持 scroll_methods.on_button_down 则受支持。

scroll_button_lock_default(state: uint<river_libinput_device_v1.scroll_button_lock_state>)
默认滚动按钮锁定状态

默认滚动按钮锁定状态。 如果支持 scroll_methods.on_button_down 则受支持。

scroll_button_lock_current(state: uint<river_libinput_device_v1.scroll_button_lock_state>)
当前滚动按钮锁定状态

当前滚动按钮锁定状态。 如果支持 scroll_methods.on_button_down 则受支持。

dwt_support(supported: int)
参数
类型
描述
supportedint
boolean
支持打字时禁用

如果 supported 参数非零,则支持打字时禁用。

默认打字时禁用状态

默认打字时禁用状态。

当前打字时禁用状态

当前打字时禁用状态。

dwtp_support(supported: int)
参数
类型
描述
supportedint
boolean
支持使用指点杆时禁用

如果 supported 参数非零,则支持使用指点杆时禁用。

默认使用指点杆时禁用状态

默认使用指点杆时禁用状态。

当前使用指点杆时禁用状态

当前使用指点杆时禁用状态。

rotation_support(supported: int)
参数
类型
描述
supportedint
boolean
支持旋转

如果 supported 参数非零,则支持旋转。

rotation_default(angle: uint)
参数
类型
描述
angleuint
默认旋转角度

默认旋转角度。

rotation_current(angle: uint)
参数
类型
描述
angleuint
当前旋转角度

当前旋转角度。

error { invalid_arg } 
参数
描述
invalid_arg0
无效的枚举值或类似参数
tap_button_map { lrm, lmr } 
参数
描述
lrm0
1/2/3 指轻触分别映射为左键/右键/中键
lmr1
1/2/3 指轻触分别映射为左键/中键/右键
clickfinger_button_map { lrm, lmr } 
参数
描述
lrm0
lmr1

加速配置

libinput 设置设备配置时返回的结果。

destroy()
销毁 accel 对象

此请求表明客户端将不再使用 accel 配置对象,可以安全地销毁它。

参数
类型
描述
resultnew_id<river_libinput_result_v1>
typeuint<river_libinput_accel_config_v1.accel_type>
steparray
double
pointsarray
array of doubles
定义自定义加速函数

定义使用自定义加速配置文件的加速配置中 给定移动类型的加速函数。

error { invalid_arg } 
参数
描述
invalid_arg0
无效的枚举值或类似参数

配置应用结果

libinput 设置设备配置时返回的结果。

success()
配置成功

配置已成功应用到设备。

unsupported()
配置不受支持

设备不支持此配置,已被忽略。

invalid()
配置无效

配置无效,已被忽略。


合成器支持

未发现合成器支持

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.

Footer

© 2026 Wayland Explorer

本网站与 Wayland 官方项目无任何关联。网站所有内容均根据 Wayland 协议 XML 文件自动生成。

本网站使用的 Visual Studio Code - Codicons 遵循 CC BY 4.0 许可。