diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 3c589ee10..9a6a1032a 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -1557,6 +1557,11 @@ void _glfwPlatformSetWindowUseRawInput(_GLFWwindow* window, GLFWbool enabled) window->useRawInput = enabled; } +GLFWbool _glfwPlatformRawInputSupported(void) +{ + return GLFW_FALSE; +} + void _glfwPlatformPollEvents(void) { if (!initializeAppKit()) diff --git a/src/input.c b/src/input.c index b0bb3de47..2186fdd71 100644 --- a/src/input.c +++ b/src/input.c @@ -1305,3 +1305,8 @@ GLFWAPI uint64_t glfwGetTimerFrequency(void) return _glfwPlatformGetTimerFrequency(); } +GLFWAPI int glfwRawInputSupported(void) +{ + _GLFW_REQUIRE_INIT_OR_RETURN(0); + return _glfwPlatformRawInputSupported(); +} diff --git a/src/internal.h b/src/internal.h index 8cc47a354..79ff17690 100644 --- a/src/internal.h +++ b/src/internal.h @@ -623,6 +623,7 @@ void _glfwPlatformUpdateGamepadGUID(char* guid); uint64_t _glfwPlatformGetTimerValue(void); uint64_t _glfwPlatformGetTimerFrequency(void); +GLFWbool _glfwPlatformRawInputSupported(void); int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, diff --git a/src/null_window.c b/src/null_window.c index 2535cdb99..831c27da3 100644 --- a/src/null_window.c +++ b/src/null_window.c @@ -201,6 +201,11 @@ void _glfwPlatformSetWindowUseRawInput(_GLFWwindow* window, GLFWbool enabled) window->useRawInput = enabled; } +GLFWbool _glfwPlatformRawInputSupported(void) +{ + return GLFW_FALSE; +} + void _glfwPlatformShowWindow(_GLFWwindow* window) { } diff --git a/src/win32_window.c b/src/win32_window.c index 655acd33f..5ff1e00ad 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1865,6 +1865,11 @@ void _glfwPlatformSetWindowUseRawInput(_GLFWwindow* window, GLFWbool enabled) } } +GLFWbool _glfwPlatformRawInputSupported(void) +{ + return GLFW_TRUE; +} + void _glfwPlatformPollEvents(void) { MSG msg; diff --git a/src/wl_window.c b/src/wl_window.c index 642dce017..fa0e63973 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1309,6 +1309,11 @@ void _glfwPlatformSetWindowUseRawInput(_GLFWwindow* window, GLFWbool enabled) window->useRawInput = enabled; } +GLFWbool _glfwPlatformRawInputSupported(void) +{ + return GLFW_FALSE; +} + void _glfwPlatformPollEvents(void) { handleEvents(0); diff --git a/src/x11_window.c b/src/x11_window.c index 375a4dbf3..dac096095 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -2667,6 +2667,11 @@ void _glfwPlatformSetWindowUseRawInput(_GLFWwindow* window, GLFWbool enabled) } } +GLFWbool _glfwPlatformRawInputSupported(void) +{ + return _glfw.x11.xi.available; +} + void _glfwPlatformPollEvents(void) { _GLFWwindow* window;