bindShortcuts

suspend fun bindShortcuts(shortcuts: List<Shortcut>, parentWindow: String = ""): Result<List<BoundShortcut>>(source)

Bind shortcuts to the active session. This allows the application to receive activation events when the user triggers the shortcuts.

The first time a shortcut is bound, the portal presents a system dialog for the user to review and confirm. Subsequent calls with the same shortcut ID bind automatically without user interaction, as the portal remembers the user's prior approval.

Shortcuts must be bound in every new session — listShortcuts will return an empty list until this method is called, even if shortcuts were bound in a previous session.

Uses the session handle from createSession automatically.

Return

Result containing the list of bound shortcuts with their assigned triggers.

Parameters

shortcuts

List of shortcuts to bind.

parentWindow

Identifier for the application window. Use empty string if no parent window.


suspend fun bindShortcuts(sessionHandle: DBusPath, shortcuts: List<Shortcut>, parentWindow: String = ""): Result<List<BoundShortcut>>(source)

Bind shortcuts to the session. This allows the application to receive activation events when the user triggers the shortcuts.

The first time a shortcut is bound, the portal presents a system dialog for the user to review and confirm. Subsequent calls with the same shortcut ID bind automatically without user interaction, as the portal remembers the user's prior approval.

Shortcuts must be bound in every new session — listShortcuts will return an empty list until this method is called, even if shortcuts were bound in a previous session.

Return

Result containing the list of bound shortcuts with their assigned triggers.

Parameters

sessionHandle

Object path for the session created via createSession.

shortcuts

List of shortcuts to bind.

parentWindow

Identifier for the application window. Use empty string if no parent window.