[][src]Function rs_glfw3::bindings::glfwSetInputMode

pub unsafe extern "C" fn glfwSetInputMode(
    window: *mut GLFWwindow,
    mode: c_int,
    value: c_int
)

@brief Sets an input option for the specified window.

This function sets an input mode option for the specified window. The mode must be one of GLFW_CURSOR, GLFW_STICKY_KEYS or GLFW_STICKY_MOUSE_BUTTONS.

If the mode is GLFW_CURSOR, the value must be one of the following cursor modes:

  • GLFW_CURSOR_NORMAL makes the cursor visible and behaving normally.
  • GLFW_CURSOR_HIDDEN makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving.
  • GLFW_CURSOR_DISABLED hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.

If the mode is GLFW_STICKY_KEYS, the value must be either GLFW_TRUE to enable sticky keys, or GLFW_FALSE to disable it. If sticky keys are enabled, a key press will ensure that @ref glfwGetKey returns GLFW_PRESS the next time it is called even if the key had been released before the call. This is useful when you are only interested in whether keys have been pressed but not when or in which order.

If the mode is GLFW_STICKY_MOUSE_BUTTONS, the value must be either GLFW_TRUE to enable sticky mouse buttons, or GLFW_FALSE to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that @ref glfwGetMouseButton returns GLFW_PRESS the next time it is called even if the mouse button had been released before the call. This is useful when you are only interested in whether mouse buttons have been pressed but not when or in which order.

@param[in] window The window whose input mode to set. @param[in] mode One of GLFW_CURSOR, GLFW_STICKY_KEYS or GLFW_STICKY_MOUSE_BUTTONS. @param[in] value The new value of the specified input mode.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.

@thread_safety This function must only be called from the main thread.

@sa glfwGetInputMode

@since Added in version 3.0. Replaces glfwEnable and glfwDisable.

@ingroup input