9#include <IEventReceiver.h>
23 KeyPress(
const SEvent::SKeyInput &in);
26 std::string
sym()
const;
29 std::string
name()
const;
40 if (
auto pv = std::get_if<u32>(&
scancode))
60 return std::holds_alternative<EKEY_CODE>(
scancode) ?
61 Keycode::isValid(std::get<EKEY_CODE>(
scancode)) :
70 void loadFromKey(EKEY_CODE keycode,
wchar_t keychar);
75 friend std::hash<KeyPress>;
82 return std::hash<KeyPress::value_type>{}(kp.scancode);
89#define EscapeKey KeyPress::getSpecialKey("KEY_ESCAPE")
90#define LMBKey KeyPress::getSpecialKey("KEY_LBUTTON")
91#define MMBKey KeyPress::getSpecialKey("KEY_MBUTTON")
92#define RMBKey KeyPress::getSpecialKey("KEY_RBUTTON")
void loadFromKey(EKEY_CODE keycode, wchar_t keychar)
Definition keycode.cpp:286
u32 getScancode() const
Definition keycode.h:38
EKEY_CODE getKeycode() const
Definition keycode.cpp:332
bool loadFromScancode(const std::string &name)
Definition keycode.cpp:342
static KeyPress getSpecialKey(const std::string &name)
Definition keycode.cpp:355
std::string sym() const
Definition keycode.cpp:314
std::string name() const
Definition keycode.cpp:322
bool operator!=(KeyPress o) const
Definition keycode.h:48
wchar_t getKeychar() const
Definition keycode.cpp:337
std::variant< u32, EKEY_CODE > value_type
Definition keycode.h:68
bool operator==(KeyPress o) const
Definition keycode.h:45
bool operator<(KeyPress o) const
Definition keycode.h:53
std::string formatScancode() const
Definition keycode.cpp:307
value_type scancode
Definition keycode.h:73
KeyPress getKeySetting(const std::string &settingname)
Definition keycode.cpp:370
void clearKeyCache()
Definition keycode.cpp:385
size_t operator()(KeyPress kp) const noexcept
Definition keycode.h:81