The Input class provides access to keyboard and mouse input.
More...
#include <Input.hpp>
The Input class provides access to keyboard and mouse input.
- Note
- This class is a singleton and constructable. Use is as follows:
Util::Input::IsKeyPressed(Keycode::A), Util::Input::IsLButtonDown(), etc.
◆ GetCursorPosition()
◆ GetScrollDistance()
| static glm::vec2 Util::Input::GetScrollDistance |
( |
| ) |
|
|
static |
Retrieves the scroll distance of an element.
.
The scroll distance is the distance that the mouse wheel has been scrolled. The distance is expressed in multiples or fractions of lines; for example, if the mouse wheel is rotated three lines downward, the scroll distance is {-1.0F, 0.0F}. If the mouse wheel is rotated three lines upward, the scroll distance is {1.0F, 0.0F}. If the mouse wheel is rotated three lines right, the scroll distance is {0.0F, 1.0F}. If the mouse wheel is rotated three lines left, the scroll distance is {0.0F, -1.0F}.
- Returns
- The scroll distance as vec2(x,y).
◆ IfExit()
| static bool Util::Input::IfExit |
( |
| ) |
|
|
static |
Checks if the window is closed.
- Returns
- true if the window is closed, false otherwise.
◆ IfScroll()
| static bool Util::Input::IfScroll |
( |
| ) |
|
|
static |
Checks if the mouse wheel is currently being scrolled.
- Returns
- A bool value representing the current state of the mouse wheel.
◆ IsKeyDown()
| static bool Util::Input::IsKeyDown |
( |
const Keycode & |
key | ) |
|
|
static |
Check if a specific key is being pressed.
This function checks whether the given key is currently being pressed.
- Parameters
-
| key | The keycode of the key to check. |
- Returns
- true if
key is currently pressed, false otherwise.
- See also
- Util::Keycode
◆ IsKeyPressed()
| static bool Util::Input::IsKeyPressed |
( |
const Keycode & |
key | ) |
|
|
static |
Check if a specific key is currently pressed.
This function checks whether the given key is currently pressed.
- Parameters
-
| key | The keycode of the key to check. |
- Returns
- true if
key is currently pressed, false otherwise.
- See also
- Util::Keycode
◆ IsKeyUp()
| static bool Util::Input::IsKeyUp |
( |
const Keycode & |
key | ) |
|
|
static |
Check if a specific key is being un-pressed.
This function checks whether the given key is currently being un-pressed.
- Parameters
-
| key | The keycode of the key to check. |
- Returns
- true if
key is currently pressed, false otherwise.
- See also
- Util::Keycode
◆ IsMouseMoving()
| static bool Util::Input::IsMouseMoving |
( |
| ) |
|
|
static |
Checks if the mouse is currently moving.
- Returns
- true if the mouse is currently moving, false otherwise.
◆ SetCursorPosition()
◆ Update()
| static void Util::Input::Update |
( |
| ) |
|
|
static |
Updates the state of the input.
- Warning
- DO NOT CALL THIS METHOD. It is called by context::Update() already.
The documentation for this class was generated from the following file: