|
sfml_impl 0.1.0
Vendor SFML 3.0.2 : IGraphic2Module / IAudioModule
|
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 |
| bool | isKeyPressed (Keys key) const override |
| bool | isKeyReleased (Keys key) const override |
| bool | isKeyDown (Keys key) const override |
| bool | isKeyUp (Keys key) const override |
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 |