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.
|
| |
Manages user input events such as keyboard, mouse movement, and scrolling. Uses function callbacks to handle input from a given window.
◆ getInstance()
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.
- Аргументы
-
| callback | Function 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.
- Аргументы
-
| callback | Function 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.
- Аргументы
-
| callback | Function 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.
- Аргументы
-
| window | Pointer to the window where input will be captured. |
Объявления и описания членов класса находятся в файле: