soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SAccelerator Class Reference

Accelerator key mapping. More...

#include <SAccelerator.h>

Inheritance diagram for SAccelerator:
IAccelerator SHotKeyCtrl

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SAccelerator() [1/2]

SAccelerator::SAccelerator ( DWORD dwAccel)

Constructor.

Parameters
dwAccelAccelerator key value

Initializes the accelerator with a given accelerator key value.

Definition at line 18 of file SAccelerator.cpp.

◆ SAccelerator() [2/2]

SNSBEGIN SAccelerator::SAccelerator ( WORD vKey = 0,
bool bCtrl = false,
bool bAlt = false,
bool bShift = false )

Constructor.

Parameters
vKeyKey value
bCtrlTRUE if combined with Ctrl
bAltTRUE if combined with Alt
bShiftTRUE 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::~SAccelerator ( void )

Destructor.

Cleans up the accelerator object.

Definition at line 24 of file SAccelerator.cpp.

Member Function Documentation

◆ FormatAccelKey()

SStringT SAccelerator::FormatAccelKey ( DWORD dwAccel)
static

Formats an accelerator key as a string.

Parameters
dwAccelAccelerator key value
Returns
SStringT - Formatted string representation of the accelerator key

Converts an accelerator key value into a human-readable string format.

Definition at line 199 of file SAccelerator.cpp.

◆ FormatHotkey()

SStringT SAccelerator::FormatHotkey ( )

Formats the accelerator key as a string.

Returns
SStringT - Formatted string representation of the accelerator key

Converts the accelerator key into a human-readable string format.

Definition at line 28 of file SAccelerator.cpp.

◆ GetAcc()

DWORD SAccelerator::GetAcc ( )

Gets the accelerator key value.

Returns
Accelerator key value as a DWORD

Returns the complete accelerator key value, including modifiers and key.

Implements IAccelerator.

Definition at line 267 of file SAccelerator.cpp.

◆ GetKey()

WORD SAccelerator::GetKey ( )

Gets the key value.

Returns
Key value as a WORD

Returns the key value associated with the accelerator.

Implements IAccelerator.

Definition at line 262 of file SAccelerator.cpp.

◆ GetKeyName()

SStringT SAccelerator::GetKeyName ( WORD vk)
static

Converts a virtual key code to its string representation.

Parameters
vkVirtual key code
Returns
SStringT - String representation of the key

Converts a virtual key code to its human-readable string format.

Definition at line 114 of file SAccelerator.cpp.

◆ GetModifier()

WORD SAccelerator::GetModifier ( )

Gets the modifier keys.

Returns
Modifier keys as a WORD

Returns the modifier keys (Ctrl, Alt, Shift) as a WORD.

Implements IAccelerator.

Definition at line 257 of file SAccelerator.cpp.

◆ TranslateAccelKey()

DWORD SAccelerator::TranslateAccelKey ( LPCTSTR pszKeyName)
static

Translates a string to an accelerator key value.

Parameters
pszKeyNameString representation of the accelerator key
Returns
DWORD - Accelerator key value

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.

◆ VkFromString()

WORD SAccelerator::VkFromString ( LPCTSTR pszKey)
static

Converts a string to a virtual key code.

Parameters
pszKeyString representation of the key
Returns
Virtual key code as a WORD

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.

Member Data Documentation

◆ m_wModifier

WORD SAccelerator::m_wModifier
protected

Modifier keys (Ctrl, Alt, Shift) as a WORD.

Definition at line 125 of file SAccelerator.h.

◆ m_wVK

WORD SAccelerator::m_wVK
protected

Key value as a WORD.

Definition at line 126 of file SAccelerator.h.


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