diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 59d4488bf..d5cad8adc 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1979,7 +1979,7 @@ const char* _glfwPlatformGetNativeKeyName(int keycode) return _glfw.ns.keyName; } -int _glfwPlatformGetNativeKeyForKey(int key) +int _glfwPlatformGetNativeKeyForKey(uint32_t key) { return _glfw.ns.key_to_keycode[key]; } diff --git a/glfw/glfw3.h b/glfw/glfw3.h index 2fc76f1dd..11756b0c1 100644 --- a/glfw/glfw3.h +++ b/glfw/glfw3.h @@ -1738,7 +1738,7 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double,int,int); * This is the function pointer type for key callbacks. A keyboard * key callback function has the following signature: * @code - * void function_name(GLFWwindow* window, int key, int native_key, int action, int mods) + * void function_name(GLFWwindow* window, uint32_t key, int native_key, int action, int mods) * @endcode * The semantics of this function are that the key that is interacted with on the * keyboard is reported, and the text, if any generated by the key is reported. @@ -4499,7 +4499,7 @@ GLFWAPI int glfwRawMouseMotionSupported(void); * * @ingroup input */ -GLFWAPI const char* glfwGetKeyName(int key, int native_key); +GLFWAPI const char* glfwGetKeyName(uint32_t key, int native_key); /*! @brief Returns the platform-specific identifier of the specified key. * @@ -4523,7 +4523,7 @@ GLFWAPI const char* glfwGetKeyName(int key, int native_key); * * @ingroup input */ -GLFWAPI int glfwGetNativeKeyForKey(int key); +GLFWAPI int glfwGetNativeKeyForKey(uint32_t key); /*! @brief Returns the last reported state of a keyboard key for the specified * window. diff --git a/glfw/internal.h b/glfw/internal.h index 6d8a15f50..c7b7685ba 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -654,7 +654,7 @@ void _glfwPlatformDestroyCursor(_GLFWcursor* cursor); void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor); const char* _glfwPlatformGetNativeKeyName(int native_key); -int _glfwPlatformGetNativeKeyForKey(int key); +int _glfwPlatformGetNativeKeyForKey(uint32_t key); void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor); void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos); diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 90e9f1ae1..87e44da55 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -1346,7 +1346,7 @@ const char* _glfwPlatformGetNativeKeyName(int native_key) return glfw_xkb_keysym_name(native_key); } -int _glfwPlatformGetNativeKeyForKey(int key) +int _glfwPlatformGetNativeKeyForKey(uint32_t key) { return glfw_xkb_sym_for_key(key); } diff --git a/glfw/x11_window.c b/glfw/x11_window.c index d7c31e1b0..70fb09ebc 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -2778,7 +2778,7 @@ const char* _glfwPlatformGetNativeKeyName(int native_key) return glfw_xkb_keysym_name(native_key); } -int _glfwPlatformGetNativeKeyForKey(int key) +int _glfwPlatformGetNativeKeyForKey(uint32_t key) { return glfw_xkb_sym_for_key(key); } diff --git a/glfw/xkb_glfw.c b/glfw/xkb_glfw.c index ff15b29fc..bb4f4551d 100644 --- a/glfw/xkb_glfw.c +++ b/glfw/xkb_glfw.c @@ -228,7 +228,7 @@ glfw_key_for_sym(xkb_keysym_t key) { } xkb_keysym_t -glfw_xkb_sym_for_key(int key) { +glfw_xkb_sym_for_key(uint32_t key) { #define S(f, t) case GLFW_KEY_##t: return XKB_KEY_##f #define F(...) #define R(s, e, gs, ge) case GLFW_KEY_##gs ... GLFW_KEY_##ge: return XKB_KEY_##s + key - GLFW_KEY_##gs diff --git a/glfw/xkb_glfw.h b/glfw/xkb_glfw.h index eea09fbaa..39b74c851 100644 --- a/glfw/xkb_glfw.h +++ b/glfw/xkb_glfw.h @@ -89,7 +89,7 @@ bool glfw_xkb_compile_keymap(_GLFWXKBData *xkb, const char *map_str); void glfw_xkb_update_modifiers(_GLFWXKBData *xkb, xkb_mod_mask_t depressed, xkb_mod_mask_t latched, xkb_mod_mask_t locked, xkb_layout_index_t base_group, xkb_layout_index_t latched_group, xkb_layout_index_t locked_group); bool glfw_xkb_should_repeat(_GLFWXKBData *xkb, xkb_keycode_t keycode); const char* glfw_xkb_keysym_name(xkb_keysym_t sym); -xkb_keysym_t glfw_xkb_sym_for_key(int key); +xkb_keysym_t glfw_xkb_sym_for_key(uint32_t key); void glfw_xkb_handle_key_event(_GLFWwindow *window, _GLFWXKBData *xkb, xkb_keycode_t keycode, int action); int glfw_xkb_keysym_from_name(const char *name, bool case_sensitive); void glfw_xkb_update_ime_state(_GLFWwindow *w, _GLFWXKBData *xkb, int which, int a, int b, int c, int d);