#include <Input.hpp>
A class for querying input state (keyboard, mouse, touch). The Input class is tied to a smk::Window. You need to call regularly smk::Screen::PoolEvent to update the input state.
More...
A class for querying input state (keyboard, mouse, touch). The Input class is tied to a smk::Window. You need to call regularly smk::Screen::PoolEvent to update the input state.
To know keyboard and mouse buttons identifer, you need to refer to the GLFW definitions:
- See also
- smk::Window::PoolEvents()
Definition at line 29 of file Input.hpp.
|
class | CharacterListenerInterface |
| Receive characters typed from the keyboard. All the keyboard modifiers are applied (Shift, Ctrl, Alt, ...). Useful for implementing input boxes. More...
|
|
◆ CharacterListener
◆ FingerID
using smk::Input::FingerID = int |
◆ ~Input()
virtual smk::Input::~Input |
( |
| ) |
|
|
inlinevirtual |
◆ cursor()
virtual glm::vec2 smk::Input::cursor |
( |
| ) |
const |
|
pure virtual |
The cursor position.
- Returns
- the cursor position.
Implemented in smk::InputImpl.
◆ IsCursorHeld()
virtual bool smk::Input::IsCursorHeld |
( |
| ) |
|
|
pure virtual |
Whether the cursor is down or not.
- Returns
- true whenever the cursor is down.
Implemented in smk::InputImpl.
◆ IsCursorPressed()
virtual bool smk::Input::IsCursorPressed |
( |
| ) |
|
|
pure virtual |
Whether the cursor is pressed or not.
- Returns
- true whenever the cursor is pressed.
Implemented in smk::InputImpl.
◆ IsCursorReleased()
virtual bool smk::Input::IsCursorReleased |
( |
| ) |
|
|
pure virtual |
Whether the cursor is released or not.
- Returns
- true whenever the cursor is released.
Implemented in smk::InputImpl.
◆ IsKeyHold()
virtual bool smk::Input::IsKeyHold |
( |
int |
key | ) |
|
|
pure virtual |
Whether a keyboard button is down or not.
- Returns
- true whenever a keyboard button is hold.
- Parameters
-
Implemented in smk::InputImpl.
◆ IsKeyPressed()
virtual bool smk::Input::IsKeyPressed |
( |
int |
key | ) |
|
|
pure virtual |
Whether a keyboard button is pressed or not.
- Returns
- true whenever a keyboard button is pressed.
- Parameters
-
Implemented in smk::InputImpl.
◆ IsKeyReleased()
virtual bool smk::Input::IsKeyReleased |
( |
int |
key | ) |
|
|
pure virtual |
Whether a keyboard button is released or not.
- Returns
- true whenever a keyboard button is released
- Parameters
-
Implemented in smk::InputImpl.
◆ IsMouseHeld()
virtual bool smk::Input::IsMouseHeld |
( |
int |
key | ) |
|
|
pure virtual |
Whether a mouse button is down or not.
- Returns
- true whenever a mouse button is hold.
- Parameters
-
Implemented in smk::InputImpl.
◆ IsMousePressed()
virtual bool smk::Input::IsMousePressed |
( |
int |
key | ) |
|
|
pure virtual |
Whether a mouse button is pressed or not.
- Returns
- true whenever a mouse button is pressed.
- Parameters
-
Implemented in smk::InputImpl.
◆ IsMouseReleased()
virtual bool smk::Input::IsMouseReleased |
( |
int |
key | ) |
|
|
pure virtual |
Whether a mouse button is released or not.
- Returns
- true whenever a mouse button is released
- Parameters
-
Implemented in smk::InputImpl.
◆ mouse()
virtual glm::vec2 smk::Input::mouse |
( |
| ) |
const |
|
pure virtual |
The mouse position.
- Returns
- the mouse position.
Implemented in smk::InputImpl.
◆ scroll_offset()
virtual glm::vec2 smk::Input::scroll_offset |
( |
| ) |
const |
|
pure virtual |
The mouse/touchpad scrolling offset since the last frame.
- Returns
- the scrolling offset.
Implemented in smk::InputImpl.
◆ touches()
virtual std::map< FingerID, Touch > & smk::Input::touches |
( |
| ) |
|
|
pure virtual |
The touch states.
- Returns
- the touches states.
Implemented in smk::InputImpl.
The documentation for this class was generated from the following file:
- /home/arthursonzogni/programmation/real/smk/include/smk/Input.hpp