|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <input.hpp>
Public Member Functions | |
| void | _pollInput () override |
| KeyInput | dequeueKeyInput () override |
| MouseInput | dequeueMouseInput () override |
| std::string | dequeueTextInput () override |
| Input () | |
| bool | isKeyQueueEmpty () override |
| bool | isMouseQueueEmpty () override |
| bool | isTextQueueEmpty () 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 |
Static Protected Member Functions | |
| static MouseInput::Button | convertMouseButton (int button) |
Protected Attributes | |
| std::queue< KeyInput > | mKeyInputQueue |
| bool | mMouseDown {false} |
| std::queue< MouseInput > | mMouseInputQueue |
| bool | mMouseInWindow {false} |
| std::queue< std::string > | mTextInputQueue |
SDL3-specific implementation of Input.
Definition at line 36 of file backends/sdl3/input.hpp.
| fcn::sdl3::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 57 of file backends/sdl3/input.hpp.
|
staticprotected |
Converts a mouse button from SDL to a FifeGUI mouse button.
| button | an SDL mouse button. |
Definition at line 176 of file input.cpp.
Referenced by pushInput().
|
overridevirtual |
Dequeues the key input queue.
Implements fcn::Input.
Definition at line 30 of file input.cpp.
References mKeyInputQueue, and fcn::throwException().
|
overridevirtual |
Dequeues the mouse input queue.
Implements fcn::Input.
Definition at line 49 of file input.cpp.
References mMouseInputQueue, and fcn::throwException().
|
overridevirtual |
Dequeues a UTF-8 text string from the text input queue.
Base implementation returns an empty string. Override in backends that support text input (e.g. SDL3).
Reimplemented from fcn::Input.
Definition at line 68 of file input.cpp.
References mTextInputQueue.
|
overridevirtual |
Checks if the key queue is empty, or not.
Implements fcn::Input.
Definition at line 25 of file input.cpp.
References mKeyInputQueue.
|
overridevirtual |
Checks if the mouse queue is empyt, or not.
Implements fcn::Input.
Definition at line 44 of file input.cpp.
References mMouseInputQueue.
|
overridevirtual |
Checks if the text input queue is empty.
Base implementation returns true (no text queue). Override in backends that support text input (e.g. SDL3).
Reimplemented from fcn::Input.
Definition at line 63 of file input.cpp.
References mTextInputQueue.
|
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 78 of file input.cpp.
References convertMouseButton(), mKeyInputQueue, mMouseDown, mMouseInputQueue, mMouseInWindow, mTextInputQueue, 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 85 of file backends/sdl3/input.hpp.
Referenced by dequeueKeyInput(), isKeyQueueEmpty(), and pushInput().
|
protected |
True if a mouse button is currently held down.
Definition at line 94 of file backends/sdl3/input.hpp.
Referenced by pushInput().
|
protected |
Queue of mouse inputs waiting to be processed.
Definition at line 88 of file backends/sdl3/input.hpp.
Referenced by dequeueMouseInput(), isMouseQueueEmpty(), and pushInput().
|
protected |
True if the mouse cursor is currently within the application window.
Definition at line 97 of file backends/sdl3/input.hpp.
Referenced by Input(), and pushInput().
|
protected |
Queue of text input strings waiting to be processed.
Definition at line 91 of file backends/sdl3/input.hpp.
Referenced by dequeueTextInput(), isTextQueueEmpty(), and pushInput().