#include <keyboard_state.h>
|
class | GLFWManager |
|
class | Window |
|
class | ImGuiManager |
|
Keeps track of the state of the keyboard.
This class keeps track of the state of the keyboard. Normally, you would find access to instances of this class through Window instances, because every Window has different keyboard states. Access the KeyboardState by calling Window::GetKeyboardState().
void blowbox::KeyboardState::AddInputKey |
( |
unsigned int |
key | ) |
|
|
protected |
Adds an input key.
- Parameters
-
[in] | key | The key that was pressed (as a unicode id) |
Queue< unsigned int > blowbox::KeyboardState::GetInputKeys |
( |
| ) |
const |
- Returns
- A list of keys that were pressed over the last frame, in the correct order. Every item in the queue is a unicode ID.
bool blowbox::KeyboardState::GetKey |
( |
KeyCode |
key | ) |
|
Find out whether a key is down or not.
- Parameters
-
[in] | key | The key you want to know the down-state of. |
- Returns
- Whether the key is down or not.
bool blowbox::KeyboardState::GetKeyDown |
( |
KeyCode |
key | ) |
|
Find out whether a key is down or not.
- Parameters
-
[in] | key | The key you want to know the down-state of. |
- Returns
- Whether the key is down or not.
bool blowbox::KeyboardState::GetKeyPressed |
( |
KeyCode |
key | ) |
|
Find out whether a key is pressed or not.
- Parameters
-
[in] | key | The key you want to know the pressed-state of. |
- Returns
- Whether the key is pressed or not.
bool blowbox::KeyboardState::GetKeyReleased |
( |
KeyCode |
key | ) |
|
Find out whether a key is released or not.
- Parameters
-
[in] | key | The key you want to know the released-state of. |
- Returns
- Whether the key is released or not.
Retrieves the full state of a key.
- Parameters
-
[in] | key | The key you want to know the full KeyState of. |
- Returns
- The full KeyState of a key.
void blowbox::KeyboardState::ResetKeys |
( |
| ) |
|
|
protected |
Resets all keys by changing their press & release states to false.
void blowbox::KeyboardState::SetKeyModifiers |
( |
KeyCode |
key, |
|
|
int |
modifiers |
|
) |
| |
|
protected |
Changes the key modifiers of a key to true.
- Parameters
-
[in] | key | The key to be changed. |
[in] | modifiers | The modifiers that were pressed when the key was pressed. |
void blowbox::KeyboardState::SetKeyPressed |
( |
KeyCode |
key | ) |
|
|
protected |
Changes the press-state of a key to true.
- Parameters
-
[in] | key | The key to be changed. |
void blowbox::KeyboardState::SetKeyReleased |
( |
KeyCode |
key | ) |
|
|
protected |
Changes the release-state of a key to true.
- Parameters
-
[in] | key | The key to be changed. |
Queue<unsigned int> blowbox::KeyboardState::input_keys_ |
|
private |
The keys that were pressed over the last frame, in correct order. These are stored in unicode ids.
A map of KeyCodes to KeyStates.
The documentation for this class was generated from the following files:
- C:/Projects/blowbox-2017/src/win32/keyboard_state.h
- C:/Projects/blowbox-2017/src/win32/keyboard_state.cc