Implementing WindowsScancodes
This commit is contained in:
@@ -21,8 +21,6 @@ public:
|
||||
WindowsScancode winScanCode;
|
||||
};
|
||||
|
||||
|
||||
|
||||
namespace Keys {
|
||||
static const Key Escape {'\b', X11Scancode::ESCAPE, WindowsScancode::ESCAPE};
|
||||
static const Key F1 {'\u000f', X11Scancode::F1, WindowsScancode::F1};
|
||||
@@ -120,14 +118,21 @@ namespace MouseButtons
|
||||
static const MouseButton Middle;
|
||||
static const MouseButton Side1;
|
||||
static const MouseButton Side2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static Key GetKeyFromX11Scancode(X11Scancode code)
|
||||
{
|
||||
for (auto& key : Key::GetKeyboard()) {
|
||||
if (key.x11ScanCode == code)
|
||||
return key;
|
||||
}
|
||||
}
|
||||
throw "Unavaliable Scancode: " + std::to_string((int)code);
|
||||
}
|
||||
static Key GetKeyFromWindowsScancode(WindowsScancode code)
|
||||
{
|
||||
for (auto& key : Key::GetKeyboard()) {
|
||||
if (key.winScanCode == code)
|
||||
return key;
|
||||
}
|
||||
throw "Unavaliable Scancode: " + std::to_string((int)code);
|
||||
}
|
||||
|
Reference in New Issue
Block a user