nngn
|
Mouse event manager. More...
#include <mouse.h>
Public Types | |
enum class | Action : std::uint8_t { PRESS = 1 , RELEASE = 0 } |
Public Member Functions | |
void | init (lua_State *L_) |
void | register_button_callback () |
Registers a Lua function called when a button is pressed. | |
void | register_move_callback () |
Registers a Lua function called when the mouse position changes. | |
bool | button_callback (int button, int action, int mods) |
Triggers a button event. | |
bool | move_callback (dvec2 pos) |
Triggers a move event. | |
Private Attributes | |
lua_State * | L = {} |
int | button_cb = {} |
int | move_cb = {} |
Mouse event manager.
Registered Lua callback functions are later called when events happen. Events are manually triggered using the *_callback(...)
functions.
|
strong |
Triggers a button event.
|
inline |
Triggers a move event.
void nngn::MouseInput::register_button_callback | ( | ) |
Registers a Lua function called when a button is pressed.
The Lua stack is expected to contain the function object at the top.
void nngn::MouseInput::register_move_callback | ( | ) |
Registers a Lua function called when the mouse position changes.
The Lua stack is expected to contain the function object at the top.
|
private |
|
private |
|
private |