Definition at line 10 of file KeyStroke.h.
Public Member Functions | |
KeyStroke (const SDL_keysym &keysym) | |
Create new keystroke from event. | |
KeyStroke (SDLKey sym, int mod) | |
Create new keystroke. | |
SDLKey | getKey () const |
Uint16 | getUnicode () const |
bool | less (const KeyStroke &other) const |
KeyStroke comparation. | |
bool | equals (const KeyStroke &other) const |
Test keyStroke equality. | |
std::string | toString () const |
Return text fashion. |
|
Create new keystroke from event.
Definition at line 17 of file KeyStroke.cpp. 00018 { 00019 m_sym = keysym.sym; 00020 m_mod = modStrip(keysym.mod); 00021 m_unicode = keysym.unicode; 00022 }
|
|
Create new keystroke. NOTE: KMOD_ALT mean (KMOD_LALT and KMOD_RALT), i.e. either ALTs pressed!
Definition at line 32 of file KeyStroke.cpp. 00033 { 00034 m_sym = sym; 00035 m_mod = modStrip(mod); 00036 m_unicode = 0; 00037 }
|
|
Test keyStroke equality. KMOD_NUM|KMOD_CAPS|KMOD_MODE are ignored.
Definition at line 73 of file KeyStroke.cpp.
|
|
Definition at line 22 of file KeyStroke.h. 00022 { return m_sym; }
|
|
Definition at line 23 of file KeyStroke.h. 00023 { return m_unicode; }
|
|
KeyStroke comparation.
Definition at line 56 of file KeyStroke.cpp. 00057 { 00058 bool result = m_sym < other.m_sym; 00059 if (m_sym == other.m_sym) { 00060 result = m_mod < other.m_mod; 00061 } 00062 return result; 00063 }
|
|
Return text fashion.
Definition at line 83 of file KeyStroke.cpp. 00084 { 00085 std::string result = SDL_GetKeyName(m_sym); 00086 result.append("+" + StringTool::toString(m_mod)); 00087 return result; 00088 }
|