glfwSetCharModsCallback function

GLFWcharmodsfun glfwSetCharModsCallback(
  1. Pointer<GLFWwindow> window,
  2. GLFWcharmodsfun callback
)

! @brief Sets the Unicode character with modifiers callback.

This function sets the character with modifiers callback of the specified window, which is called when a Unicode character is input regardless of what modifier keys are used.

The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see the character callback(@ref glfwSetCharCallback). Like the character callback, the character with modifiers callback deals with characters and is keyboard layout dependent. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback(@ref glfwSetKeyCallback) instead.

@paramin window The window whose callback to set. @paramin callback The new callback, or NULL to remove the currently set callback. @return The previously set callback, or NULL if no callback was set or an error(@ref error_handling) occurred.

@callback_signature @code void function_name(GLFWwindow* window, unsigned int codepoint, int mods) @endcode For more information about the callback parameters, see the function pointer type(@ref GLFWcharmodsfun).

@deprecated Scheduled for removal in version 4.0.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

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

@sa @ref input_char

@since Added in version 3.1.

@ingroup input

GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback)

Implementation

GLFWcharmodsfun glfwSetCharModsCallback(
    Pointer<GLFWwindow> window, GLFWcharmodsfun callback) {
  final glfwSetCharModsCallbackLookupFunction = libglfw.lookupFunction<
      GLFWcharmodsfun Function(
          Pointer<GLFWwindow> window, GLFWcharmodsfun callback),
      GLFWcharmodsfun Function(Pointer<GLFWwindow> window,
          GLFWcharmodsfun callback)>('glfwSetCharModsCallback');
  return glfwSetCharModsCallbackLookupFunction(window, callback);
}