|
FifeGUI 0.2.0
A C++ GUI library designed for games.
|
#include <input.hpp>
Public Member Functions | |
| void | _pollInput () override |
| KeyInput | dequeueKeyInput () override |
| MouseInput | dequeueMouseInput () override |
| Input () | |
| bool | isKeyQueueEmpty () override |
| bool | isMouseQueueEmpty () override |
| virtual void | pushInput (SDL_Event event) |
| Public Member Functions inherited from fcn::Input | |
| Input (Input &&)=delete | |
| Input (Input const &)=delete | |
| Input & | operator= (Input &&)=delete |
| Input & | operator= (Input const &)=delete |
Protected Member Functions | |
| MouseInput::Button | convertMouseButton (int button) |
| int | convertSDLEventToFifechanKeyValue (SDL_Event event) |
Protected Attributes | |
| std::queue< KeyInput > | mKeyInputQueue |
| bool | mMouseDown {false} |
| std::queue< MouseInput > | mMouseInputQueue |
| bool | mMouseInWindow {false} |
SDL2-specific implementation of Input.
Definition at line 30 of file backends/sdl2/input.hpp.
| fcn::sdl2::Input::Input | ( | ) |
|
inlineoverridevirtual |
Polls all input.
It exists for input driver compatibility. If you only use SDL and plan sticking with SDL you can safely ignore this function as it in the SDL case does nothing.
Implements fcn::Input.
Definition at line 51 of file backends/sdl2/input.hpp.
|
protected |
Converts a mouse button from SDL to a FifeGUI mouse button.
| button | an SDL mouse button. |
Definition at line 205 of file input.cpp.
Referenced by pushInput().
|
protected |
Converts an SDL event to a FifeGUI key value.
| event | The SDL event to convert. |
Definition at line 228 of file input.cpp.
Referenced by pushInput().
|
overridevirtual |
Dequeues the key input queue.
Implements fcn::Input.
Definition at line 22 of file input.cpp.
References mKeyInputQueue.
|
overridevirtual |
Dequeues the mouse input queue.
Implements fcn::Input.
Definition at line 41 of file input.cpp.
References mMouseInputQueue.
|
overridevirtual |
Checks if the key queue is empty, or not.
Implements fcn::Input.
Definition at line 17 of file input.cpp.
References mKeyInputQueue.
|
overridevirtual |
Checks if the mouse queue is empyt, or not.
Implements fcn::Input.
Definition at line 36 of file input.cpp.
References mMouseInputQueue.
|
virtual |
Pushes an SDL event.
It should be called at least once per frame to update input with user input.
| event | an event from SDL. |
Definition at line 55 of file input.cpp.
References convertMouseButton(), convertSDLEventToFifechanKeyValue(), mKeyInputQueue, mMouseDown, mMouseInputQueue, mMouseInWindow, fcn::KeyInput::setAltPressed(), fcn::MouseInput::setButton(), fcn::KeyInput::setControlPressed(), fcn::KeyInput::setKey(), fcn::KeyInput::setMetaPressed(), fcn::KeyInput::setNumericPad(), fcn::KeyInput::setShiftPressed(), fcn::MouseInput::setTimeStamp(), fcn::KeyInput::setType(), fcn::MouseInput::setType(), fcn::MouseInput::setX(), and fcn::MouseInput::setY().
|
protected |
Queue of key inputs waiting to be processed.
Definition at line 82 of file backends/sdl2/input.hpp.
Referenced by dequeueKeyInput(), isKeyQueueEmpty(), and pushInput().
|
protected |
True if a mouse button is currently held down.
Definition at line 88 of file backends/sdl2/input.hpp.
Referenced by pushInput().
|
protected |
Queue of mouse inputs waiting to be processed.
Definition at line 85 of file backends/sdl2/input.hpp.
Referenced by dequeueMouseInput(), isMouseQueueEmpty(), and pushInput().
|
protected |
True if the mouse cursor is currently within the application window.
Definition at line 91 of file backends/sdl2/input.hpp.
Referenced by Input(), and pushInput().