FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::Shortcut Class Reference

Keyboard shortcut definition (key + mods). More...

#include <Keybinds.h>

Public Member Functions

 Shortcut ()
 Creates an empty shortcut.
 Shortcut (const char *str)
 Parses a shortcut from a string representation.
 Shortcut (bool requiresCtrl, bool requiresShift, bool requiresSuper, KeyMask key)
 Creates a shortcut from modifier flags and a key mask.
 operator char * () const
 Converts the shortcut to a display string.
bool IsPressed () const
 Returns whether the full shortcut is active.
bool operator== (const Shortcut &other) const
 Returns whether two shortcuts are identical.

Public Attributes

bool RequiresCtrl
 Whether Ctrl must be held.
bool RequiresShift
 Whether Shift must be held.
bool RequiresSuper
 Whether Super/Meta must be held.
KeyMask Key
 Primary key mask for the shortcut.

Detailed Description

Keyboard shortcut definition (key + mods).

Represents a combo of a main key + mods like shift, meta, super.

Invariant
Key holds the primary input key.
RequiresXXXX hold their corresponding modifier keys.

Constructor & Destructor Documentation

◆ Shortcut() [1/3]

FuncDoodle::Shortcut::Shortcut ( )

Creates an empty shortcut.

◆ Shortcut() [2/3]

FuncDoodle::Shortcut::Shortcut ( const char * str)

Parses a shortcut from a string representation.

Parameters
strShortcut string to parse.

◆ Shortcut() [3/3]

FuncDoodle::Shortcut::Shortcut ( bool requiresCtrl,
bool requiresShift,
bool requiresSuper,
KeyMask key )

Creates a shortcut from modifier flags and a key mask.

Parameters
requiresCtrlWhether Ctrl is required.
requiresShiftWhether Shift is required.
requiresSuperWhether Super/Meta is required.
keyMain key or key combination.

Member Function Documentation

◆ IsPressed()

bool FuncDoodle::Shortcut::IsPressed ( ) const
nodiscard

Returns whether the full shortcut is active.

Returns
Whether the shortcut is currently pressed.

◆ operator char *()

FuncDoodle::Shortcut::operator char * ( ) const

Converts the shortcut to a display string.

Returns
C string describing the shortcut.

◆ operator==()

bool FuncDoodle::Shortcut::operator== ( const Shortcut & other) const
inline

Returns whether two shortcuts are identical.

Parameters
otherShortcut to compare against.
Returns
Whether both shortcuts match.

Member Data Documentation

◆ Key

KeyMask FuncDoodle::Shortcut::Key

Primary key mask for the shortcut.

◆ RequiresCtrl

bool FuncDoodle::Shortcut::RequiresCtrl

Whether Ctrl must be held.

◆ RequiresShift

bool FuncDoodle::Shortcut::RequiresShift

Whether Shift must be held.

◆ RequiresSuper

bool FuncDoodle::Shortcut::RequiresSuper

Whether Super/Meta must be held.


The documentation for this class was generated from the following files: