Public Member Functions
|bool||CheckKeyState (int key)|
|Checks key state. |
|Clears the key buffer. |
|Un-stacks the current state. |
|Stacks the current state. |
|void||SetKeyState (bool pressed, int key)|
|Sets key state. |
Static Public Member Functions
|static Keyboard *||GetInstance (void)|
|Gets an object for this class. |
|Keyboard * e2d::core::Keyboard::GetInstance||(||void||)||
This class is a Singleton. If you want an instance of this class to work with, get it via this method.
With this method you are able to verify if a key is being or not pressed on the keyboard.
|key||The key you want to check the state of: see SDL documentation for key constants.|
Clears the key buffer by setting all key states to false.
Recovers the last pushed keyboard buffer state, or resets the buffer (with ClearBuffer()) if there was nothing on the stack.
Stores the current keyboard buffer state into an internal stack.
With this method you can set a key state yourself. Note that if a key is not pressed and you set its state to pressed, it will remain in a state of pressed even if the key is not really being pressed on the keyboard. But, if the real key is pressed and then released, then it will switch to the state of unpressed.
|pressed||Set it to true if you want the key to be seen as pressed, and set it to false otherwise.|
|key||The key you want to change the state: see SDL documentation for key constants.|