|
P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
|
Maps the contract's keys to sfml scancodes, and reads the state the window accumulated while popping its events. More...
#include <SfmlKeyboard.hpp>


Public Member Functions | |
| SfmlKeyboard (const SfmlWindow &window) | |
| ~SfmlKeyboard () override=default | |
| std::vector< Keys > | whichKeyDown () const override |
| Every key HELD right now - like isKeyDown, without having to name the key. | |
| bool | isKeyPressed (Keys key) const override |
| Check if the key is pressed. | |
| bool | isKeyReleased (Keys key) const override |
| Check if the key is released. | |
| bool | isKeyDown (Keys key) const override |
| Check if the key is down. | |
| bool | isKeyUp (Keys key) const override |
| Check if the key is up. | |
| Public Member Functions inherited from graphic::IKeyboard | |
| virtual | ~IKeyboard () |
| Destroy the IKeyboard object. | |
Maps the contract's keys to sfml scancodes, and reads the state the window accumulated while popping its events.
The window is handed over at construction (the module passes it), so the link can never be missing. The methods are defined in SfmlWindow.hpp, once SfmlWindow is complete.
The reference is CONST : querying the keyboard cannot consume anything, and the compiler guarantees it. Only pollEvent() and endDraw() mutate, on the window side. That is what lets an arcade and the game running inside it read the same key in the same frame.
Modifiers are keys like any other : Shift+E is isKeyDown(KEY_LEFT_SHIFT) and isKeyPressed(KEY_E), composed by the caller.
|
inline |
|
overridedefault |