LampyEngine
 
Загрузка...
Поиск...
Не найдено
Класс InputModule

Manages user input events such as keyboard, mouse movement, and scrolling. Uses function callbacks to handle input from a given window. Подробнее...

#include <InputModule.h>

Открытые члены

 InputModule ()
 Constructs an empty InputModule.
 
 ~InputModule ()
 Destroys the InputModule.
 
void startUp (Window *window)
 Initializes the input system and registers callbacks for input events.
 
void shutDown ()
 Shuts down the input system and clears registered callbacks.
 
void setKeyCallback (const std::function< void(int key, int scancode, int action, int mods)> &callback)
 Sets a callback function for keyboard input events.
 
void setCursorPositionCallback (const std::function< void(double xpos, double ypos)> &callback)
 Sets a callback function for mouse cursor position events.
 
void setScrollCallback (const std::function< void(double xoffset, double yoffset)> &callback)
 Sets a callback function for mouse scroll events.
 

Открытые статические члены

static InputModulegetInstance ()
 Retrieves the singleton instance of the InputModule.
 

Подробное описание

Manages user input events such as keyboard, mouse movement, and scrolling. Uses function callbacks to handle input from a given window.

Методы

◆ getInstance()

static InputModule & InputModule::getInstance ( )
inlinestatic

Retrieves the singleton instance of the InputModule.

Возвращает
Reference to the singleton InputModule instance.

◆ setCursorPositionCallback()

void InputModule::setCursorPositionCallback ( const std::function< void(double xpos, double ypos)> & callback)
inline

Sets a callback function for mouse cursor position events.

Аргументы
callbackFunction to be called when the mouse moves.

◆ setKeyCallback()

void InputModule::setKeyCallback ( const std::function< void(int key, int scancode, int action, int mods)> & callback)
inline

Sets a callback function for keyboard input events.

Аргументы
callbackFunction to be called when a key event occurs.

◆ setScrollCallback()

void InputModule::setScrollCallback ( const std::function< void(double xoffset, double yoffset)> & callback)
inline

Sets a callback function for mouse scroll events.

Аргументы
callbackFunction to be called when the mouse wheel is scrolled.

◆ startUp()

void InputModule::startUp ( Window * window)
inline

Initializes the input system and registers callbacks for input events.

Аргументы
windowPointer to the window where input will be captured.

Объявления и описания членов класса находятся в файле: