Accelerator key mapping. More...
#include <SAccelerator.h>
Public Member Functions | |
| SAccelerator (DWORD dwAccel) | |
| Constructor. | |
| SAccelerator (WORD vKey=0, bool bCtrl=false, bool bAlt=false, bool bShift=false) | |
| Constructor. | |
| ~SAccelerator (void) | |
| Destructor. | |
| WORD | GetModifier () SCONST OVERRIDE |
| Gets the modifier keys. | |
| WORD | GetKey () SCONST OVERRIDE |
| Gets the key value. | |
| DWORD | GetAcc () SCONST OVERRIDE |
| Gets the accelerator key value. | |
| SStringT | FormatHotkey () |
| Formats the accelerator key as a string. | |
Static Public Member Functions | |
| static WORD | VkFromString (LPCTSTR pszKey) |
| Converts a string to a virtual key code. | |
| static SStringT | GetKeyName (WORD vk) |
| Converts a virtual key code to its string representation. | |
| static SStringT | FormatAccelKey (DWORD dwAccel) |
| Formats an accelerator key as a string. | |
| static DWORD | TranslateAccelKey (LPCTSTR pszKeyName) |
| Translates a string to an accelerator key value. | |
Protected Attributes | |
| WORD | m_wModifier |
| WORD | m_wVK |
Accelerator key mapping.
This class manages accelerator keys, allowing for the creation and manipulation of accelerator key mappings within the SOUI framework.
Definition at line 28 of file SAccelerator.h.
| SAccelerator::SAccelerator | ( | DWORD | dwAccel | ) |
Constructor.
| dwAccel | Accelerator key value |
Initializes the accelerator with a given accelerator key value.
Definition at line 18 of file SAccelerator.cpp.
| SNSBEGIN SAccelerator::SAccelerator | ( | WORD | vKey = 0, |
| bool | bCtrl = false, | ||
| bool | bAlt = false, | ||
| bool | bShift = false ) |
Constructor.
| vKey | Key value |
| bCtrl | TRUE if combined with Ctrl |
| bAlt | TRUE if combined with Alt |
| bShift | TRUE if combined with Shift |
Initializes the accelerator with a key value and modifier keys (Ctrl, Alt, Shift).
Definition at line 6 of file SAccelerator.cpp.
| SAccelerator::~SAccelerator | ( | void | ) |
|
static |
Formats an accelerator key as a string.
| dwAccel | Accelerator key value |
Converts an accelerator key value into a human-readable string format.
Definition at line 199 of file SAccelerator.cpp.
| SStringT SAccelerator::FormatHotkey | ( | ) |
Formats the accelerator key as a string.
Converts the accelerator key into a human-readable string format.
Definition at line 28 of file SAccelerator.cpp.
| DWORD SAccelerator::GetAcc | ( | ) |
Gets the accelerator key value.
Returns the complete accelerator key value, including modifiers and key.
Implements IAccelerator.
Definition at line 267 of file SAccelerator.cpp.
| WORD SAccelerator::GetKey | ( | ) |
Gets the key value.
Returns the key value associated with the accelerator.
Implements IAccelerator.
Definition at line 262 of file SAccelerator.cpp.
|
static |
Converts a virtual key code to its string representation.
| vk | Virtual key code |
Converts a virtual key code to its human-readable string format.
Definition at line 114 of file SAccelerator.cpp.
| WORD SAccelerator::GetModifier | ( | ) |
Gets the modifier keys.
Returns the modifier keys (Ctrl, Alt, Shift) as a WORD.
Implements IAccelerator.
Definition at line 257 of file SAccelerator.cpp.
|
static |
Translates a string to an accelerator key value.
| pszKeyName | String representation of the accelerator key |
Converts a string representation of an accelerator key (e0.g., "Ctrl+C") to its corresponding accelerator key value.
Definition at line 219 of file SAccelerator.cpp.
|
static |
Converts a string to a virtual key code.
| pszKey | String representation of the key |
Converts a string representation of a key (e.g., "Ctrl+C") to its corresponding virtual key code.
Definition at line 33 of file SAccelerator.cpp.
|
protected |
Modifier keys (Ctrl, Alt, Shift) as a WORD.
Definition at line 125 of file SAccelerator.h.
|
protected |
Key value as a WORD.
Definition at line 126 of file SAccelerator.h.