diff options
Diffstat (limited to 'src/input/input.h')
-rw-r--r-- | src/input/input.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/input/input.h b/src/input/input.h index 2127417..7fd3293 100644 --- a/src/input/input.h +++ b/src/input/input.h @@ -135,10 +135,17 @@ #define HONEY_KEY_PRESS GLFW_PRESS #define HONEY_KEY_RELEASE GLFW_RELEASE +#define HONEY_MOUSE_MODE_NORMAL GLFW_CURSOR_NORMAL +#define HONEY_MOUSE_MODE_HIDDEN GLFW_CURSOR_HIDDEN +#define HONEY_MOUSE_MODE_DISABLED GLFW_CURSOR_DISABLED + unsigned int honey_key_states[HONEY_N_KEYS]; static int honey_key_callbacks[HONEY_N_KEYS]; static int honey_key_callbacks_data[HONEY_N_KEYS]; +extern int honey_mouse_movement_callback_ref; +extern int honey_mouse_movement_callback_data_ref; + /** @brief Initializes Honey's internal keyboard states. * * This function is called by honey_setup, so you shouldn't need @@ -191,6 +198,32 @@ int honey_key_unbind(lua_State* L); */ int honey_key_unbind_all(lua_State* L); -void default_honey_keyboard_callback(honey_window window, int key, int scancode, int action, int mods); +/** @brief Set the cursor mode. + * + * @param[in] mode The mouse mode (from honey.input.mouse.mode) to use. + * + * @returns Nothing. + */ +int honey_mouse_set_mode(lua_State* L); + +/** Bind a callback to mouse movement. + * + * The callback should be of the form cb(xpos, ypos, data), + * where xpos and ypos are the coordinates of the mouse relative to the + * upper left corner of the window, and data is the data parameter passed + * to this function. + * + * @param[in] callback A callback as described above. + * @param[in] data Auxilliary data to pass to the callback. + * + * @returns Nothing. + */ +int honey_mouse_movement_bind(lua_State* L); + +/** Unbind any callback that may be attached to mouse movement. + * + * @returns Nothing. + */ +int honey_mouse_movement_unbind(lua_State* L); #endif |