29 const std::string& name =
"",
30 unsigned int holdTime = 0,
31 unsigned int buttonCode = 0);
32 CAction(
int actionID,
wchar_t unicode);
39 float velocityX = 0.0f,
40 float velocityY = 0.0f,
41 const std::string& name =
"");
42 CAction(
int actionID,
const std::string& name,
const CKey& key);
43 CAction(
int actionID,
const std::string& name);
51 int GetID()
const {
return m_id; }
58 bool IsGesture()
const;
63 const std::string&
GetName()
const {
return m_name; }
68 const std::string&
GetText()
const {
return m_text; }
73 void SetText(
const std::string& text) { m_text = text; }
81 return (index < max_amounts) ? m_amount[index] : 0;
108 bool IsAnalog()
const;
114 static const unsigned int max_amounts = 6;
115 float m_amount[max_amounts] = {};
117 float m_repeat = 0.0f;
118 unsigned int m_holdTime = 0;
119 unsigned int m_buttonCode = 0;
120 wchar_t m_unicode = 0;
float GetRepeat() const
Time since last repeat in ms.
Definition: Action.h:101
void ClearAmount()
Reset all amount values to zero.
Definition: Action.cpp:136
int GetID() const
Identifier of the action.
Definition: Action.h:51
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
unsigned int GetHoldTime() const
Time in ms that the key has been held.
Definition: Action.h:96
unsigned int GetButtonCode() const
Button code that triggered this action.
Definition: Action.h:106
void SetText(const std::string &text)
Set the text payload of the action.
Definition: Action.h:73
wchar_t GetUnicode() const
Unicode value associated with this action.
Definition: Action.h:91
float GetAmount(unsigned int index=0) const
Get an amount associated with this action.
Definition: Action.h:79
bool IsMouse() const
Is this an action from the mouse.
Definition: Action.cpp:142
const std::string & GetText() const
Text of the action if any.
Definition: Action.h:68
const std::string & GetName() const
Human-readable name of the action.
Definition: Action.h:63