FifeGUI 0.3.0
A C++ GUI library designed for games.
input.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_INPUT_HPP_
6#define INCLUDE_FIFECHAN_INPUT_HPP_
7
8// Standard library includes
9#include <cstdint>
10#include <string>
11
12// Platform config include
13#include "fifechan/platform.hpp"
14
15namespace fcn
16{
17 class KeyInput;
18 class MouseInput;
19
36 class FIFEGUI_API Input
37 {
38 public:
39 virtual ~Input() = default;
40
41 Input(Input const &) = delete;
42 Input& operator=(Input const &) = delete;
43 Input(Input&&) = delete;
44 Input& operator=(Input&&) = delete;
45
52 virtual bool isKeyQueueEmpty() = 0;
53
60
67 virtual bool isMouseQueueEmpty() = 0;
68
75
84 virtual bool isTextQueueEmpty()
85 {
86 return true;
87 }
88
97 virtual std::string dequeueTextInput()
98 {
99 return {};
100 }
101
111 virtual void _pollInput() = 0;
112
113 protected:
114 Input() = default;
115 };
116} // namespace fcn
117
118#endif // INCLUDE_FIFECHAN_INPUT_HPP_
virtual MouseInput dequeueMouseInput()=0
Dequeues the mouse input queue.
virtual bool isKeyQueueEmpty()=0
Checks if the key queue is empty, or not.
virtual bool isMouseQueueEmpty()=0
Checks if the mouse queue is empyt, or not.
virtual bool isTextQueueEmpty()
Checks if the text input queue is empty.
Definition input.hpp:84
virtual void _pollInput()=0
Polls all existing input.
virtual std::string dequeueTextInput()
Dequeues a UTF-8 text string from the text input queue.
Definition input.hpp:97
virtual KeyInput dequeueKeyInput()=0
Dequeues the key input queue.
Internal class representing raw keyboard input data.
Definition keyinput.hpp:32
Internal class representing raw mouse input data.
Used replacement tokens by configure_file():