Class that can interact with the keyboard.
More...
#include <Keys.h>
|
| | Keys () |
| auto | update () -> void |
| auto | showMenu () -> void |
| auto | getInputMap () const -> const std::unordered_map< int, std::string > & |
| | Returns the map of glfw mouse button codes.
|
| auto | getEnabled () const -> bool |
| | Returns if key input is currently enabled or not.
|
| auto | setEnabled (bool newState) -> void |
| | Sets whether input from the keyboard is accepted or not.
|
|
| static auto | keyCallback (GLFWwindow *window, int pressedKey, int scancode, int action, int mods) -> void |
| | Registers which keys are pressed.
|
| static auto | sendKeyPressedMessage (unsigned int GLFWKey) -> void |
| | Callback used by GLFW whenever a button on the keyboard is pressed/released. Broadcasts a message on press.
|
| static constexpr auto | getKeyDeviceID () -> int |
| | Used to keep our use of the Key input device ID consistent.
|
|
| std::unordered_map< int, std::string > | keyMap |
| | A map that takes GLFW mouse button codes and maps them to input event names.
|
| bool | enabled |
| | If this is off, we don't do anything on key press.
|
|
| static constexpr auto | keyDeviceID = -1 |
| | ID representing all key input done.
|
Class that can interact with the keyboard.
@Keys.h
◆ Keys()
◆ getEnabled()
| auto Keys::getEnabled |
( |
| ) |
const->bool |
Returns if key input is currently enabled or not.
◆ getInputMap()
| auto Keys::getInputMap |
( |
| ) |
const->conststd::unordered_map< int, std::string > & |
Returns the map of glfw mouse button codes.
◆ getKeyDeviceID()
| constexpr auto Keys::getKeyDeviceID |
( |
| ) |
->int |
|
inlinestaticconstexpr |
Used to keep our use of the Key input device ID consistent.
◆ keyCallback()
| auto Keys::keyCallback |
( |
GLFWwindow * | window, |
|
|
int | pressedKey, |
|
|
int | scancode, |
|
|
int | action, |
|
|
int | mods )->void |
|
static |
Registers which keys are pressed.
◆ sendKeyPressedMessage()
| auto Keys::sendKeyPressedMessage |
( |
unsigned int | GLFWKey | ) |
->void |
|
static |
Callback used by GLFW whenever a button on the keyboard is pressed/released. Broadcasts a message on press.
- Todo
- : Add proper logging for this
◆ setEnabled()
| auto Keys::setEnabled |
( |
bool | newState | ) |
->void |
Sets whether input from the keyboard is accepted or not.
◆ showMenu()
| auto Keys::showMenu |
( |
| ) |
->void |
◆ update()
| auto Keys::update |
( |
| ) |
->void |
◆ enabled
If this is off, we don't do anything on key press.
◆ keyDeviceID
| auto Keys::keyDeviceID = -1 |
|
staticconstexprprivate |
ID representing all key input done.
◆ keyMap
| std::unordered_map<int, std::string> Keys::keyMap |
|
private |
A map that takes GLFW mouse button codes and maps them to input event names.
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/Framework/Keys.h
- /home/egrazil/sites/Brunot/The House/source/Framework/Keys.cpp