FifeGUI 0.3.0
A C++ GUI library designed for games.
fcn::Input Class Referenceabstract

#include <input.hpp>

Inheritance diagram for fcn::Input:
fcn::GenericInput fcn::sdl3::Input

Public Member Functions

virtual void _pollInput ()=0
virtual KeyInput dequeueKeyInput ()=0
virtual MouseInput dequeueMouseInput ()=0
virtual std::string dequeueTextInput ()
 Input (Input &&)=delete
 Input (Input const &)=delete
virtual bool isKeyQueueEmpty ()=0
virtual bool isMouseQueueEmpty ()=0
virtual bool isTextQueueEmpty ()
Input & operator= (Input &&)=delete
Input & operator= (Input const &)=delete

Detailed Description

Abstract interface for polling user input devices.

FifeGUI contains implementations of Input for common libraries like SDL. To make FifeGUI usable with other libraries, an Input class must be implemented.

Note
Functions beginning with underscore "_" should not be overloaded unless you know what you are doing.
See also
SDLInput

Definition at line 36 of file input.hpp.

Member Function Documentation

◆ _pollInput()

virtual void fcn::Input::_pollInput ( )
pure virtual

Polls all existing input.

Called when input should be polled.

Note
Provided for compatibility with backend libraries that require input polling at a fixed update rate.

Implemented in fcn::GenericInput, and fcn::sdl3::Input.

◆ dequeueKeyInput()

virtual KeyInput fcn::Input::dequeueKeyInput ( )
pure virtual

Dequeues the key input queue.

Returns
The first key input in the key input queue.

Implemented in fcn::GenericInput, and fcn::sdl3::Input.

◆ dequeueMouseInput()

virtual MouseInput fcn::Input::dequeueMouseInput ( )
pure virtual

Dequeues the mouse input queue.

Returns
The first mouse input in the mouse input queue.

Implemented in fcn::GenericInput, and fcn::sdl3::Input.

◆ dequeueTextInput()

virtual std::string fcn::Input::dequeueTextInput ( )
inlinevirtual

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).

Returns
The UTF-8 text string.

Reimplemented in fcn::sdl3::Input.

Definition at line 97 of file input.hpp.

◆ isKeyQueueEmpty()

virtual bool fcn::Input::isKeyQueueEmpty ( )
pure virtual

Checks if the key queue is empty, or not.

Returns
True if the key queue is empty, false otherwise.

Implemented in fcn::GenericInput, and fcn::sdl3::Input.

◆ isMouseQueueEmpty()

virtual bool fcn::Input::isMouseQueueEmpty ( )
pure virtual

Checks if the mouse queue is empyt, or not.

Returns
True if the mouse queue is empty, false otherwise.

Implemented in fcn::GenericInput, and fcn::sdl3::Input.

◆ isTextQueueEmpty()

virtual bool fcn::Input::isTextQueueEmpty ( )
inlinevirtual

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).

Returns
True if the text queue is empty, false otherwise.

Reimplemented in fcn::sdl3::Input.

Definition at line 84 of file input.hpp.


The documentation for this class was generated from the following file: