Skip to content

Commit 68a7db6

Browse files
James Chen-Smithvberger
James Chen-Smith
authored andcommitted
protocols: introduce misc/virtual-keyboard-unstable-v1
1 parent f00b28d commit 68a7db6

File tree

3 files changed

+133
-2
lines changed

3 files changed

+133
-2
lines changed

wayland-protocols-misc/CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# CHANGELOG: wayland-protocols-misc
22

3-
## Unreleased
3+
## Unreleased
4+
5+
### Additions
6+
7+
- Introduce protocol `virtual-keyboard-unstable-v1`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<protocol name="virtual_keyboard_unstable_v1">
3+
<copyright>
4+
Copyright © 2008-2011 Kristian Høgsberg
5+
Copyright © 2010-2013 Intel Corporation
6+
Copyright © 2012-2013 Collabora, Ltd.
7+
Copyright © 2018 Purism SPC
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a
10+
copy of this software and associated documentation files (the "Software"),
11+
to deal in the Software without restriction, including without limitation
12+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
13+
and/or sell copies of the Software, and to permit persons to whom the
14+
Software is furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice (including the next
17+
paragraph) shall be included in all copies or substantial portions of the
18+
Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
27+
</copyright>
28+
29+
<interface name="zwp_virtual_keyboard_v1" version="1">
30+
<description summary="virtual keyboard">
31+
The virtual keyboard provides an application with requests which emulate
32+
the behaviour of a physical keyboard.
33+
34+
This interface can be used by clients on its own to provide raw input
35+
events, or it can accompany the input method protocol.
36+
</description>
37+
38+
<request name="keymap">
39+
<description summary="keyboard mapping">
40+
Provide a file descriptor to the compositor which can be
41+
memory-mapped to provide a keyboard mapping description.
42+
43+
Format carries a value from the keymap_format enumeration.
44+
</description>
45+
<arg name="format" type="uint" summary="keymap format"/>
46+
<arg name="fd" type="fd" summary="keymap file descriptor"/>
47+
<arg name="size" type="uint" summary="keymap size, in bytes"/>
48+
</request>
49+
50+
<enum name="error">
51+
<entry name="no_keymap" value="0" summary="No keymap was set"/>
52+
</enum>
53+
54+
<request name="key">
55+
<description summary="key event">
56+
A key was pressed or released.
57+
The time argument is a timestamp with millisecond granularity, with an
58+
undefined base. All requests regarding a single object must share the
59+
same clock.
60+
61+
Keymap must be set before issuing this request.
62+
63+
State carries a value from the key_state enumeration.
64+
</description>
65+
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
66+
<arg name="key" type="uint" summary="key that produced the event"/>
67+
<arg name="state" type="uint" summary="physical state of the key"/>
68+
</request>
69+
70+
<request name="modifiers">
71+
<description summary="modifier and group state">
72+
Notifies the compositor that the modifier and/or group state has
73+
changed, and it should update state.
74+
75+
The client should use wl_keyboard.modifiers event to synchronize its
76+
internal state with seat state.
77+
78+
Keymap must be set before issuing this request.
79+
</description>
80+
<arg name="mods_depressed" type="uint" summary="depressed modifiers"/>
81+
<arg name="mods_latched" type="uint" summary="latched modifiers"/>
82+
<arg name="mods_locked" type="uint" summary="locked modifiers"/>
83+
<arg name="group" type="uint" summary="keyboard layout"/>
84+
</request>
85+
86+
<request name="destroy" type="destructor" since="1">
87+
<description summary="destroy the virtual keyboard keyboard object"/>
88+
</request>
89+
</interface>
90+
91+
<interface name="zwp_virtual_keyboard_manager_v1" version="1">
92+
<description summary="virtual keyboard manager">
93+
A virtual keyboard manager allows an application to provide keyboard
94+
input events as if they came from a physical keyboard.
95+
</description>
96+
97+
<enum name="error">
98+
<entry name="unauthorized" value="0" summary="client not authorized to use the interface"/>
99+
</enum>
100+
101+
<request name="create_virtual_keyboard">
102+
<description summary="Create a new virtual keyboard">
103+
Creates a new virtual keyboard associated to a seat.
104+
105+
If the compositor enables a keyboard to perform arbitrary actions, it
106+
should present an error when an untrusted client requests a new
107+
keyboard.
108+
</description>
109+
<arg name="seat" type="object" interface="wl_seat"/>
110+
<arg name="id" type="new_id" interface="zwp_virtual_keyboard_v1"/>
111+
</request>
112+
</interface>
113+
</protocol>

wayland-protocols-misc/src/lib.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ pub mod zwp_input_method_v2 {
8989
wayland_protocol!("./protocols/input-method-unstable-v2.xml", [wayland_protocols::wp::text_input::zv3]);
9090
}
9191

92+
#[cfg(feature = "unstable_protocols")]
93+
pub mod zwp_virtual_keyboard_v1 {
94+
//! Virtual keyboard v1 unstable
95+
//!
96+
//! The virtual keyboard provides an application with requests which emulate
97+
//! the behaviour of a physical keyboard.
98+
//!
99+
//! This interface can be used by clients on its own to provide raw input
100+
//! events, or it can accompany the input method protocol.
101+
102+
wayland_protocol!("./protocols/virtual-keyboard-unstable-v1.xml", []);
103+
}
104+
92105
pub mod server_decoration {
93106
//! KDE server decoration protocol
94107
//!
@@ -99,5 +112,6 @@ pub mod server_decoration {
99112
//! side decorations.
100113
//!
101114
//! Use in conjunction with zxdg_decoration_manager_v1 is undefined.
115+
102116
wayland_protocol!("./protocols/server-decoration.xml", []);
103-
}
117+
}

0 commit comments

Comments
 (0)