River input management

配置输入设备

此协议支持创建/销毁 seat、分配输入设备到 seat,以及配置输入设备(例如设置键盘重复速率)。

本文档中的关键字“必须”(must)、“不得”(must not)、“要求”(required)、“将”(shall)、“不应”(shall not)、“应该”(should)、“不应该”(should not)、“推荐”(recommended)、“可以”(may)和“可选”(optional)将按照 IETF RFC 2119 中的描述进行解释。

输入管理器全局接口

输入管理器全局接口。

stop()
停止发送事件

此请求表示客户端不再希望接收此对象上的事件。

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

destroy()
销毁 river_input_manager_v1 对象

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

在收到 finished 事件之前发出此请求是一个协议错误。

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

create_seat(name: string)
参数
类型
描述
namestring
创建一个新的 seat

创建具有指定名称的新 seat。如果具有该名称的 seat 已经存在,则无效。

名称为 "default" 的默认 seat 始终存在,无需显式创建。

destroy_seat(name: string)
参数
类型
描述
namestring
销毁一个 seat

销毁指定名称的 seat。如果具有该名称的 seat 不存在,则无效。

名称为 "default" 的默认 seat 无法被销毁,尝试销毁它不会有任何效果。

在销毁时,分配给被销毁 seat 的任何输入设备都将被分配给默认 seat。

finished()
服务器已完成输入管理器的处理

此事件表示服务器将不再发送此对象上的任何事件。客户端应销毁该对象。有关更多信息,请参见 river_input_manager_v1.destroy。

input_device(id: new_id<river_input_device_v1>)
参数
类型
描述
idnew_id<river_input_device_v1>
宣布输入设备

在客户端绑定到 river_input_manager_v1 之后,服务器将为当前连接到系统的每个物理输入设备发送此事件。如果在客户端绑定到此接口后插入了输入设备,则也会发送此事件。

error { invalid_destroy } 
参数
描述
invalid_destroy0
协议错误

这些错误可以在响应请求时发出。


输入设备

输入设备代表物理键盘、鼠标、触摸屏或绘图板工具。它在同一时间被分配给且仅分配给一个 seat。 默认情况下,所有输入设备都被分配给默认 seat。

destroy()
销毁输入设备对象

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

assign_to_seat(name: string)
参数
类型
描述
namestring
name of the seat
将输入设备分配给 seat

将输入设备分配给 seat。所有未显式分配给 seat 的输入设备都被视为分配给了默认 seat。

如果指定名称的 seat 不存在,则无效。

set_repeat_info(rate: int, delay: int)
参数
类型
描述
rateint
rate in key repeats per second
delayint
delay in milliseconds
设置键盘重复速率和延迟

为键盘输入设备设置重复速率和延迟。如果设备不是键盘,则无效。

速率(rate)或延迟(delay)不能为负值。速率为零将禁用任何重复(无论延迟的值如何)。

set_scroll_factor(factor: fixed)
参数
类型
描述
factorfixed
设置滚动因子

为指针输入设备设置滚动因子。如果设备不是指针,则无效。

例如,因子为 0.5 将使滚动速度慢一半,而因子为 3.0 将使滚动速度快 3 倍。

设置小于 0 的滚动因子是一个协议错误。

map_to_output(output: object<wl_output>)
参数
类型
描述
outputobject<wl_output>允许为空
将输入设备映射到指定的 output

将输入设备映射到指定的 output。如果设备不是指针(pointer)、触摸(touch)或平板(tablet)设备,则无效。

如果同时映射到 output 和矩形区域(rectangle),则矩形区域优先。

传递 null 将清除现有的映射。

map_to_rectangle(x: int, y: int, width: int, height: int)
参数
类型
描述
xint
yint
widthint
heightint
将输入设备映射到指定的矩形区域

在全局 compositor 坐标空间中,将输入设备映射到指定的矩形区域。如果设备不是指针(pointer)、触摸(touch)或平板(tablet)设备,则无效。

如果同时映射到 output 和矩形区域(rectangle),则矩形区域优先。

宽度和高度必须大于或等于 0。

为宽度或高度传递 0 将清除现有的映射。

removed()
输入设备已被移除

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

在设备物理上断开连接时,服务器将发送此事件。客户端应该使用 destroy 请求销毁该对象。

参数
类型
描述
typeuint<river_input_device_v1.type>
the type of the input device

The type of the input device. This event is sent once when the river_input_device_v1 object is created. The device type cannot change during the lifetime of the object.

name(name: string)
参数
类型
描述
namestring
the name of the input device

The name of the input device. This event is sent once when the river_input_device_v1 object is created. The device name cannot change during the lifetime of the object.

参数
描述
invalid_repeat_info0
invalid_scroll_factor1
设置了非法的负数滚动因子
invalid_map_to_rectangle2
协议错误

这些错误可以在响应请求时发出。


合成器支持

未发现合成器支持

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 许可。