Virtual keyboard
- external
虚拟键盘为应用程序提供了模拟物理键盘行为的请求。
此接口可由客户端单独使用以提供原始输入事件,也可配合输入法协议使用。
向 compositor 提供一个文件描述符,可通过内存映射来提供键盘映射描述。
format 取值来自 keymap_format 枚举。
参数 | 类型 | 描述 |
|---|---|---|
| time | uint | timestamp with millisecond granularity |
| key | uint | key that produced the event |
| state | uint | physical state of the key |
按键被按下或释放。 time 参数是毫秒精度的时间戳,基准未定义。同一对象的所有请求必须使用相同的时钟。
发送此请求前必须先设置 keymap。
state 取值来自 key_state 枚举。
modifiers(mods_depressed: uint, mods_latched: uint, mods_locked: uint, group: uint)
参数 | 类型 | 描述 |
|---|---|---|
| mods_depressed | uint | depressed modifiers |
| mods_latched | uint | latched modifiers |
| mods_locked | uint | locked modifiers |
| group | uint | keyboard layout |
通知 compositor 修饰键和/或组状态已改变,应更新状态。
客户端应使用 wl_keyboard.modifiers 事件来同步其内部状态与 seat 状态。
发送此请求前必须先设置 keymap。
虚拟键盘管理器允许应用程序提供键盘输入事件,如同来自物理键盘一样。
create_virtual_keyboard(seat: object<wl_seat>, id: new_id<zwp_virtual_keyboard_v1>)
参数 | 类型 | 描述 |
|---|---|---|
| seat | object<wl_seat> | |
| id | new_id<zwp_virtual_keyboard_v1> |
创建一个与 seat 关联的新虚拟键盘。
如果 compositor 允许键盘执行任意操作,当不受信任的客户端请求新键盘时,应报错。
合成器支持
Cage | COSMIC | GameScope | Hyprland | Jay | KWin | Labwc | Louvre | Mir | Muffin | Mutter | niri | phoc | river | Sway | Treeland | Wayfire | Weston | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| zwp_virtual_keyboard_manager_v1 | 1 | 1 | x | 1 | 1 | x | 1 | x | 1 | x | x | 1 | 1 | 1 | 1 | 1 | 1 | x |
Copyright
Copyright © 2008-2011 Kristian Høgsberg Copyright © 2010-2013 Intel Corporation Copyright © 2012-2013 Collabora, Ltd. Copyright © 2018 Purism SPC
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.