Go to index / Go to protocols

hyprland_global_shortcuts_v1 ↗

registering global shortcuts

This protocol allows a client to register triggerable actions, meant to be global shortcuts.

hyprland_global_shortcuts_v1
hyprland_global_shortcuts_manager_v1

Version 1
Compositor Support
Version 1
hyprland 0.52.1

manager to register global shortcuts

This object is a manager which offers requests to create global shortcuts.

hyprland_global_shortcuts_manager_v1
request register_shortcut(
    shortcut: new_id<hyprland_global_shortcut_v1>,
    id: string,
    app_id: string,
    description: string,
    trigger_description: string,
)
  • id — a unique id for the shortcut
  • app_id — the app_id of the application requesting the shortcut
  • description — user-readable text describing what the shortcut does.
  • trigger_description — user-readable text describing how to trigger the shortcut for the client to render.

register a shortcut

Register a new global shortcut.

A global shortcut is anonymous, meaning the app does not know what key(s) trigger it.

The shortcut's keybinding shall be dealt with by the compositor.

In the case of a duplicate app_id + id combination, the already_taken protocol error is raised.

hyprland_global_shortcuts_manager_v1
request destroy()
Destructor

    destroy the manager

    All objects created by the manager will still remain valid, until their appropriate destroy request has been called.

    hyprland_global_shortcuts_manager_v1
    enum error {
        already_taken = 0,
    }
    • already_taken — the app_id + id combination has already been registered.

    hyprland_global_shortcuts_v1
    hyprland_global_shortcut_v1

    Version 1

    a shortcut

    This object represents a single shortcut.

    hyprland_global_shortcut_v1
    event pressed(
        tv_sec_hi: uint,
        tv_sec_lo: uint,
        tv_nsec: uint,
    )
    • tv_sec_hi — high 32 bits of the seconds part of the timestamp
    • tv_sec_lo — low 32 bits of the seconds part of the timestamp
    • tv_nsec — nanoseconds part of the timestamp

    keystroke pressed

    The keystroke was pressed.

    tv_ values hold the timestamp of the occurrence.

    hyprland_global_shortcut_v1
    event released(
        tv_sec_hi: uint,
        tv_sec_lo: uint,
        tv_nsec: uint,
    )
    • tv_sec_hi — high 32 bits of the seconds part of the timestamp
    • tv_sec_lo — low 32 bits of the seconds part of the timestamp
    • tv_nsec — nanoseconds part of the timestamp

    keystroke released

    The keystroke was released.

    tv_ values hold the timestamp of the occurrence.

    hyprland_global_shortcut_v1
    request destroy()
    Destructor

      delete this object, used or not

      Destroys the shortcut. Can be sent at any time by the client.