game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
ShortcutAction Struct Reference

Represents a single keyboard shortcut action. More...

#include <shortcut_manager.h>

Public Member Functions

bool isCustomized () const
 Check if shortcut has been customized.
void resetToDefault ()
 Reset to default shortcut.

Public Attributes

std::function< void()> action
 Action to execute.
std::function< bool()> canExecute
 Optional: returns false to disable temporarily.
QString category
 Category for grouping (e.g., "Game Actions").
QKeySequence currentShortcut
 Current (possibly customized) key sequence.
QKeySequence defaultShortcut
 Default key sequence.
QString description
 Optional description.
QString id
 Unique identifier (e.g., "game.launch").
bool isEnabled = true
 Whether this shortcut is currently enabled.
bool isGlobal = false
 Whether this is a global (application-wide) shortcut.
QString label
 Display name (e.g., "Launch Game").

Detailed Description

Represents a single keyboard shortcut action.

Definition at line 30 of file shortcut_manager.h.

Member Function Documentation

◆ isCustomized()

bool ShortcutAction::isCustomized ( ) const
inline

Check if shortcut has been customized.

Definition at line 47 of file shortcut_manager.h.

References currentShortcut, and defaultShortcut.

◆ resetToDefault()

void ShortcutAction::resetToDefault ( )
inline

Reset to default shortcut.

Definition at line 55 of file shortcut_manager.h.

References currentShortcut, and defaultShortcut.

Member Data Documentation

◆ action

std::function<void()> ShortcutAction::action

Action to execute.

Definition at line 41 of file shortcut_manager.h.

Referenced by ShortcutManager::triggerAction().

◆ canExecute

std::function<bool()> ShortcutAction::canExecute

Optional: returns false to disable temporarily.

Definition at line 42 of file shortcut_manager.h.

Referenced by ShortcutManager::triggerAction().

◆ category

QString ShortcutAction::category

Category for grouping (e.g., "Game Actions").

Definition at line 34 of file shortcut_manager.h.

◆ currentShortcut

QKeySequence ShortcutAction::currentShortcut

Current (possibly customized) key sequence.

Definition at line 36 of file shortcut_manager.h.

Referenced by isCustomized(), ShortcutManager::registerAction(), resetToDefault(), and ShortcutManager::setShortcut().

◆ defaultShortcut

QKeySequence ShortcutAction::defaultShortcut

Default key sequence.

Definition at line 35 of file shortcut_manager.h.

Referenced by isCustomized(), and resetToDefault().

◆ description

QString ShortcutAction::description

Optional description.

Definition at line 37 of file shortcut_manager.h.

◆ id

QString ShortcutAction::id

Unique identifier (e.g., "game.launch").

Definition at line 32 of file shortcut_manager.h.

Referenced by ShortcutManager::registerAction().

◆ isEnabled

bool ShortcutAction::isEnabled = true

Whether this shortcut is currently enabled.

Definition at line 38 of file shortcut_manager.h.

Referenced by ShortcutManager::triggerAction().

◆ isGlobal

bool ShortcutAction::isGlobal = false

Whether this is a global (application-wide) shortcut.

Definition at line 39 of file shortcut_manager.h.

◆ label

QString ShortcutAction::label

Display name (e.g., "Launch Game").

Definition at line 33 of file shortcut_manager.h.


The documentation for this struct was generated from the following file: