DesktopGlobalShortcut record

Namespace Runic.Platform in Runic.Platform 0.23.0

public sealed record DesktopGlobalShortcut : IEquatable<DesktopGlobalShortcut>

Inherits or implements IEquatable.

A named action that the user can start with a key while the application is in the background.

Parameters

Id

The action's identifier: 1 to 64 ASCII letters, digits, dots, underscores or hyphens, unique in a set. It names the action in DesktopGlobalShortcutBinding and DesktopGlobalShortcutActivation; on Linux the desktop keeps the user's binding under it, so keep it stable across releases.

Description

What the action does, at most 256 characters without NUL. The Linux desktop shows it where the user assigns keys.

Constructors

DesktopGlobalShortcut

public DesktopGlobalShortcut(string Id, string Description)

A named action that the user can start with a key while the application is in the background.

Parameters

Id

The action's identifier: 1 to 64 ASCII letters, digits, dots, underscores or hyphens, unique in a set. It names the action in DesktopGlobalShortcutBinding and DesktopGlobalShortcutActivation; on Linux the desktop keeps the user's binding under it, so keep it stable across releases.

Description

What the action does, at most 256 characters without NUL. The Linux desktop shows it where the user assigns keys.

Properties

Description

public string Description { get; init; }

What the action does, at most 256 characters without NUL. The Linux desktop shows it where the user assigns keys.

Id

public string Id { get; init; }

The action's identifier: 1 to 64 ASCII letters, digits, dots, underscores or hyphens, unique in a set. It names the action in DesktopGlobalShortcutBinding and DesktopGlobalShortcutActivation; on Linux the desktop keeps the user's binding under it, so keep it stable across releases.

PreferredShortcut

public DesktopShortcut? PreferredShortcut { get; init; }

Gets the key to bind, or null to leave the action unbound.

Remarks

On Windows and macOS this is the binding: the application records the user's choice, for example with shortcutFromEvent of @runic-artifex/views, keeps its DesktopShortcut.ToString text in its settings and passes it here. On Linux it is a suggestion: the desktop asks the user or applies its own assignment, and keeps the user's later changes.