| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <protocol name="hyprland_global_shortcuts_v1"> |
| 3 | <copyright> |
| 4 | Copyright © 2022 Vaxry |
| 5 | All rights reserved. |
| 6 | |
| 7 | Redistribution and use in source and binary forms, with or without |
| 8 | modification, are permitted provided that the following conditions are met: |
| 9 | |
| 10 | 1. Redistributions of source code must retain the above copyright notice, this |
| 11 | list of conditions and the following disclaimer. |
| 12 | |
| 13 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 14 | this list of conditions and the following disclaimer in the documentation |
| 15 | and/or other materials provided with the distribution. |
| 16 | |
| 17 | 3. Neither the name of the copyright holder nor the names of its |
| 18 | contributors may be used to endorse or promote products derived from |
| 19 | this software without specific prior written permission. |
| 20 | |
| 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | </copyright> |
| 32 | |
| 33 | <description summary="registering global shortcuts"> |
| 34 | This protocol allows a client to register triggerable actions, |
| 35 | meant to be global shortcuts. |
| 36 | </description> |
| 37 | |
| 38 | <interface name="hyprland_global_shortcuts_manager_v1" version="1"> |
| 39 | <description summary="manager to register global shortcuts"> |
| 40 | This object is a manager which offers requests to create global shortcuts. |
| 41 | </description> |
| 42 | |
| 43 | <request name="register_shortcut"> |
| 44 | <description summary="register a shortcut"> |
| 45 | Register a new global shortcut. |
| 46 | |
| 47 | A global shortcut is anonymous, meaning the app does not know what key(s) trigger it. |
| 48 | |
| 49 | The shortcut's keybinding shall be dealt with by the compositor. |
| 50 | |
| 51 | In the case of a duplicate app_id + id combination, the already_taken protocol error is raised. |
| 52 | </description> |
| 53 | <arg name="shortcut" type="new_id" interface="hyprland_global_shortcut_v1"/> |
| 54 | <arg name="id" type="string" summary="a unique id for the shortcut"/> |
| 55 | <arg name="app_id" type="string" summary="the app_id of the application requesting the shortcut"/> |
| 56 | <arg name="description" type="string" summary="user-readable text describing what the shortcut does."/> |
| 57 | <arg name="trigger_description" type="string" summary="user-readable text describing how to trigger the shortcut for the client to render."/> |
| 58 | </request> |
| 59 | |
| 60 | <request name="destroy" type="destructor"> |
| 61 | <description summary="destroy the manager"> |
| 62 | All objects created by the manager will still remain valid, until their |
| 63 | appropriate destroy request has been called. |
| 64 | </description> |
| 65 | </request> |
| 66 | |
| 67 | <enum name="error"> |
| 68 | <entry name="already_taken" value="0" |
| 69 | summary="the app_id + id combination has already been registered."/> |
| 70 | </enum> |
| 71 | </interface> |
| 72 | |
| 73 | <interface name="hyprland_global_shortcut_v1" version="1"> |
| 74 | <description summary="a shortcut"> |
| 75 | This object represents a single shortcut. |
| 76 | </description> |
| 77 | |
| 78 | <event name="pressed"> |
| 79 | <description summary="keystroke pressed"> |
| 80 | The keystroke was pressed. |
| 81 | |
| 82 | tv_ values hold the timestamp of the occurrence. |
| 83 | </description> |
| 84 | <arg name="tv_sec_hi" type="uint" |
| 85 | summary="high 32 bits of the seconds part of the timestamp"/> |
| 86 | <arg name="tv_sec_lo" type="uint" |
| 87 | summary="low 32 bits of the seconds part of the timestamp"/> |
| 88 | <arg name="tv_nsec" type="uint" |
| 89 | summary="nanoseconds part of the timestamp"/> |
| 90 | </event> |
| 91 | |
| 92 | <event name="released"> |
| 93 | <description summary="keystroke released"> |
| 94 | The keystroke was released. |
| 95 | |
| 96 | tv_ values hold the timestamp of the occurrence. |
| 97 | </description> |
| 98 | <arg name="tv_sec_hi" type="uint" |
| 99 | summary="high 32 bits of the seconds part of the timestamp"/> |
| 100 | <arg name="tv_sec_lo" type="uint" |
| 101 | summary="low 32 bits of the seconds part of the timestamp"/> |
| 102 | <arg name="tv_nsec" type="uint" |
| 103 | summary="nanoseconds part of the timestamp"/> |
| 104 | </event> |
| 105 | |
| 106 | <request name="destroy" type="destructor"> |
| 107 | <description summary="delete this object, used or not"> |
| 108 | Destroys the shortcut. Can be sent at any time by the client. |
| 109 | </description> |
| 110 | </request> |
| 111 | </interface> |
| 112 | </protocol> |