Keyboard class will handle keyboard input events.
More...
#include <keyboard.h>
Keyboard class will handle keyboard input events.
◆ Keyboard()
Default constructor set initial state of the keys (not pressed) and map the keyboard with the actions.
10 for(u32 i = 0; i < KEY_KEY_CODES_COUNT; i++){
void mapKeyboard(const std::vector< Key > keys=KEYBOARD_DEFAULT)
Map keyboard with the keys.
Definition: keyboard.cpp:41
bool keyDown[KEY_KEY_CODES_COUNT]
Array of keys.
Definition: keyboard.h:52
Key * lastkey
Last key pressed.
Definition: keyboard.h:56
Definition: keyboard.h:20
Key is a class that describe a irrlicht EKEY_CODE and what ACTION_KEYBOARD is referring.
Definition: keyboard.h:23
◆ getLastKey()
Key * Keyboard::getLastKey |
( |
| ) |
|
Get last key pressed.
Key * lastkey
Last key pressed.
Definition: keyboard.h:56
◆ IsKeyDown()
Key * Keyboard::IsKeyDown |
( |
| ) |
|
Return a pressed ::Key.
This method will check only keys ::mapKeys
- See also
- ::mapKeyboard
-
KEYBOARD_DEFAULT
-
::Key
25 for(std::vector<Key>::const_iterator it = this->
mapKeys.begin(); it != this->
mapKeys.end(); ++it){
ACTION_KEYBOARD action
Definition: keyboard.h:26
std::vector< Key > mapKeys
Map key with the ACTION_KEYBOARD specified in the Keyboard vector.
Definition: keyboard.h:54
bool keyDown[KEY_KEY_CODES_COUNT]
Array of keys.
Definition: keyboard.h:52
Key * lastkey
Last key pressed.
Definition: keyboard.h:56
Definition: keyboard.h:20
Key is a class that describe a irrlicht EKEY_CODE and what ACTION_KEYBOARD is referring.
Definition: keyboard.h:23
◆ mapKeyboard()
Map keyboard with the keys.
In particular given a configuration array of KEYBOARD::Key the KEYBOARD::Keyboard::IsKeyDown() method will check these key and will return the corresponding ACTION_KEYBOARD Default configuration see KEYBOARD_DEFAULT
- Parameters
-
keys | std::vector<Key>. Optional |
- See also
- ::Key
std::vector< Key > mapKeys
Map key with the ACTION_KEYBOARD specified in the Keyboard vector.
Definition: keyboard.h:54
◆ OnEvent()
bool Keyboard::OnEvent |
( |
const SEvent & |
event | ) |
|
|
virtual |
Virtual method called by irrlicht whenever a key is pressed.
18 if(event.EventType == EET_KEY_INPUT_EVENT)
19 this->
keyDown[
event.KeyInput.Key] =
event.KeyInput.PressedDown;
bool keyDown[KEY_KEY_CODES_COUNT]
Array of keys.
Definition: keyboard.h:52
Key * IsKeyDown()
Return a pressed ::Key.
Definition: keyboard.cpp:24
◆ resetLastKey()
void Keyboard::resetLastKey |
( |
| ) |
|
Reset last key pressed variable.
Key * lastkey
Last key pressed.
Definition: keyboard.h:56
Definition: keyboard.h:20
Key is a class that describe a irrlicht EKEY_CODE and what ACTION_KEYBOARD is referring.
Definition: keyboard.h:23
◆ keyDown
bool KEYBOARD::Keyboard::keyDown[KEY_KEY_CODES_COUNT] |
|
private |
◆ lastkey
Key* KEYBOARD::Keyboard::lastkey |
|
private |
◆ mapKeys
std::vector<Key> KEYBOARD::Keyboard::mapKeys |
|
private |
Map key with the ACTION_KEYBOARD specified in the Keyboard vector.
The documentation for this class was generated from the following files: