42 auto getInputMap()
const ->
const std::unordered_map<int, std::string>&;
51 static auto keyCallback(GLFWwindow* window,
int pressedKey,
int scancode,
int action,
int mods) -> void;
66 std::unordered_map<int, std::string>
keyMap;
std::unordered_map< int, std::string > keyMap
A map that takes GLFW mouse button codes and maps them to input event names.
Definition Keys.h:66
auto update() -> void
Definition Keys.cpp:81
auto getInputMap() const -> const std::unordered_map< int, std::string > &
Returns the map of glfw mouse button codes.
Definition Keys.cpp:85
static constexpr auto getKeyDeviceID() -> int
Used to keep our use of the Key input device ID consistent.
Definition Keys.h:58
static auto sendKeyPressedMessage(unsigned int GLFWKey) -> void
Callback used by GLFW whenever a button on the keyboard is pressed/released. Broadcasts a message on ...
Definition Keys.cpp:134
bool enabled
If this is off, we don't do anything on key press.
Definition Keys.h:69
static constexpr auto keyDeviceID
ID representing all key input done.
Definition Keys.h:72
auto showMenu() -> void
Definition Keys.cpp:90
auto setEnabled(bool newState) -> void
Sets whether input from the keyboard is accepted or not.
Definition Keys.cpp:102
auto getEnabled() const -> bool
Returns if key input is currently enabled or not.
Definition Keys.cpp:97
Keys()
Definition Keys.cpp:38
static auto keyCallback(GLFWwindow *window, int pressedKey, int scancode, int action, int mods) -> void
Registers which keys are pressed.
Definition Keys.cpp:110