Keyboard shortcuts inhibit

用于抑制 compositor 键盘快捷键的协议

此协议规定了一种方式,允许客户端请求 compositor 忽略其自身的键盘快捷键(针对给定的 seat),以便将来自该 seat 的所有按键事件转发到 surface。

警告!此文件中描述的实验性协议可能会进行不向后兼容的更改。向后兼容的更改可能会与相应的接口版本号递增一起添加。 不向后兼容的更改通过提升协议和接口名称中的版本号并重置接口版本来完成。一旦协议被声明为稳定版本,协议和接口名称中的 'z' 前缀和版本号将被移除,接口版本号也将被重置。

键盘快捷键管理器的上下文对象

用于抑制 compositor 键盘快捷键的全局接口。

destroy()
销毁键盘快捷键抑制器对象

销毁键盘快捷键抑制器管理器。

inhibit_shortcuts(id: new_id<zwp_keyboard_shortcuts_inhibitor_v1>, surface: object<wl_surface>, seat: object<wl_seat>)
参数
类型
描述
idnew_id<zwp_keyboard_shortcuts_inhibitor_v1>
surfaceobject<wl_surface>
the surface that inhibits the keyboard shortcuts behavior
seatobject<wl_seat>
the wl_seat for which keyboard shortcuts should be disabled
创建新的键盘快捷键抑制器对象

为给定的 surface 和给定的 seat 创建一个新的键盘快捷键抑制器对象。

如果指定的 seat 和 surface 已经被抑制快捷键,compositor 将引发协议错误 "already_inhibited"。

参数
描述
already_inhibited0
该 surface 的快捷键已被抑制

键盘快捷键抑制器的上下文对象

键盘快捷键抑制器指示 compositor 在关联的 surface 拥有键盘焦点时忽略其自身的键盘快捷键。因此,当该 surface 在给定的 seat 上拥有键盘焦点时,它将接收来自指定 seat 的所有按键事件,即使这些事件通常会被 compositor 用于其自身的快捷键。

然而,Wayland compositor 没有义务禁用其所有快捷键,可能会保留一些特殊组合键供自己使用,包括但不限于允许用户在客户端不配合时强制恢复正常键盘事件路由的组合键。compositor 也可以使用相同的组合键来重新激活先前因用户请求而停用的快捷键抑制器。

当 compositor 恢复其自身的键盘快捷键时,会发送 "inactive" 事件通知客户端该键盘快捷键抑制器不再对该 surface 和 seat 有效,客户端不应期望接收所有键盘事件。

当键盘快捷键抑制器处于非活动状态时,客户端无法强制重新激活该抑制器。

用户可以选择使用 compositor 提供的任何机制来重新启用先前停用的键盘快捷键抑制器,在这种情况下 compositor 将发送 "active" 事件通知客户端。

如果 surface 被销毁、取消映射或失去该 seat 的键盘焦点,键盘快捷键抑制器将变得无关紧要,compositor 将恢复其自身的键盘快捷键,但此情况下不会发送 "inactive" 事件。

destroy()
销毁键盘快捷键抑制器对象

从关联的 wl_surface 中移除键盘快捷键抑制器。

active()
快捷键已被抑制

此事件表示快捷键抑制器处于活动状态。

compositor 每次代表 surface 抑制 compositor 快捷键时都会发送此事件。当处于活动状态时,客户端可能会接收通常由 compositor 保留的输入事件(参见 zwp_keyboard_shortcuts_inhibitor_v1)。

这通常发生在初始请求 "inhibit_shortcuts" 首次变为活动状态时,或用户指示 compositor 使用其提供的任何机制重新启用现有快捷键抑制器时。

inactive()
快捷键已恢复

此事件表示快捷键抑制器处于非活动状态,compositor 恢复了正常的快捷键处理。


合成器支持

Cage
Cage
0.2.0
COSMIC
COSMIC
1.0.0~beta.8
GameScope
GameScope
3.15.14
Hyprland
Hyprland
0.52.1
Jay
1.12.0
KWin
KWin
6.6
Labwc
Labwc
0.9.2
Louvre
Louvre
2.14.1
Mir
Mir
2.26
Muffin
Muffin
6.6.0
Mutter
Mutter
49.2
niri
niri
25.11
phoc
phoc
0.52
river
river
0.3.13
Sway
Sway
1.11
Treeland
Treeland
0.8.0
Wayfire
Wayfire
0.9.0
Weston
Weston
14.0.2
zwp_keyboard_shortcuts_inhibit_manager_v1
x
1
x
1
x
1
x
x
x
1
1
1
1
x
1
x
1
x

Copyright © 2017 Red Hat Inc.

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 (including the next paragraph) 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 许可。