lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
lmgl::Input Class Reference

Static input helper class. More...

#include <input.hpp>

Static Public Member Functions

static bool is_key_pressed (core::Key key)
 Check if a key is currently pressed.
static bool is_key_just_pressed (core::Key key)
 Check if a key was just pressed this frame.
static bool is_key_just_released (core::Key key)
 Check if a key was just released this frame.
static bool is_mouse_button_pressed (int button)
 Check if a mouse button is pressed.
static glm::vec2 get_mouse_position ()
 Get mouse position.
static glm::vec2 get_mouse_delta ()
 Get mouse position delta since last frame.
static glm::vec2 get_scroll_offset ()
 Get scroll offset since last frame.
static void set_mouse_position (double x, double y)
 Set mouse position.
static void set_cursor_mode (core::CursorMode mode)
 Set cursor mode.

Detailed Description

Static input helper class.

Provides convenient static methods to check keyboard and mouse input without needing to reference the Engine singleton everywhere.

Note
This is a convenience wrapper around Engine input methods.

Member Function Documentation

◆ get_mouse_delta()

glm::vec2 lmgl::Input::get_mouse_delta ( )
static

Get mouse position delta since last frame.

Returns
Mouse delta as vec2(dx, dy).

◆ get_mouse_position()

glm::vec2 lmgl::Input::get_mouse_position ( )
static

Get mouse position.

Returns
Mouse position as vec2(x, y).

◆ get_scroll_offset()

glm::vec2 lmgl::Input::get_scroll_offset ( )
static

Get scroll offset since last frame.

Returns
Scroll offset as vec2(x_offset, y_offset).

◆ is_key_just_pressed()

bool lmgl::Input::is_key_just_pressed ( core::Key key)
static

Check if a key was just pressed this frame.

Parameters
keyKey to check.
Returns
True if just pressed.

◆ is_key_just_released()

bool lmgl::Input::is_key_just_released ( core::Key key)
static

Check if a key was just released this frame.

Parameters
keyKey to check.
Returns
True if just released.

◆ is_key_pressed()

bool lmgl::Input::is_key_pressed ( core::Key key)
static

Check if a key is currently pressed.

Parameters
keyKey to check.
Returns
True if pressed.

◆ is_mouse_button_pressed()

bool lmgl::Input::is_mouse_button_pressed ( int button)
static

Check if a mouse button is pressed.

Parameters
buttonMouse button to check (0=left, 1=right, 2=middle).
Returns
True if pressed.

◆ set_cursor_mode()

void lmgl::Input::set_cursor_mode ( core::CursorMode mode)
static

Set cursor mode.

Parameters
modeCursor mode (Normal, Hidden, Disabled).

◆ set_mouse_position()

void lmgl::Input::set_mouse_position ( double x,
double y )
static

Set mouse position.

Parameters
xX coordinate.
yY coordinate.

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