9#include <IEventReceiver.h>
24 KeyPress(
const SEvent::SKeyInput &in);
27 std::string
sym()
const;
30 std::string
name()
const;
41 if (
auto pv = std::get_if<u32>(&
scancode))
61 return std::holds_alternative<EKEY_CODE>(
scancode) ?
62 Keycode::isValid(std::get<EKEY_CODE>(
scancode)) :
71 void loadFromKey(EKEY_CODE keycode,
wchar_t keychar);
76 friend std::hash<KeyPress>;
83 return std::hash<KeyPress::value_type>{}(kp.scancode);
90#define EscapeKey KeyPress::getSpecialKey("KEY_ESCAPE")
91#define LMBKey KeyPress::getSpecialKey("KEY_LBUTTON")
92#define MMBKey KeyPress::getSpecialKey("KEY_MBUTTON")
93#define RMBKey KeyPress::getSpecialKey("KEY_RBUTTON")
99const std::vector<KeyPress> &
getKeySetting(
const std::string &settingname);
void loadFromKey(EKEY_CODE keycode, wchar_t keychar)
Definition keycode.cpp:289
u32 getScancode() const
Definition keycode.h:39
EKEY_CODE getKeycode() const
Definition keycode.cpp:335
bool loadFromScancode(const std::string &name)
Definition keycode.cpp:345
static KeyPress getSpecialKey(const std::string &name)
Definition keycode.cpp:358
std::string sym() const
Definition keycode.cpp:317
std::string name() const
Definition keycode.cpp:325
bool operator!=(KeyPress o) const
Definition keycode.h:49
wchar_t getKeychar() const
Definition keycode.cpp:340
std::variant< u32, EKEY_CODE > value_type
Definition keycode.h:69
bool operator==(KeyPress o) const
Definition keycode.h:46
bool operator<(KeyPress o) const
Definition keycode.h:54
std::string formatScancode() const
Definition keycode.cpp:310
value_type scancode
Definition keycode.h:74
const std::vector< KeyPress > & getKeySetting(const std::string &settingname)
Definition keycode.cpp:373
bool keySettingHasMatch(const std::string &settingname, KeyPress kp)
Definition keycode.cpp:391
void clearKeyCache()
Definition keycode.cpp:397
size_t operator()(KeyPress kp) const noexcept
Definition keycode.h:82