Add GLFW_RAW_INPUT and glfwRawInputSupported

From upstream: 9e29f556fd.
This commit is contained in:
Luflosi
2020-05-24 19:35:59 +02:00
parent f97e8b7eeb
commit 48fb051253
9 changed files with 111 additions and 7 deletions

10
glfw/input.c vendored
View File

@@ -675,6 +675,8 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode)
return window->stickyMouseButtons;
case GLFW_LOCK_KEY_MODS:
return window->lockKeyMods;
case GLFW_RAW_INPUT:
return window->useRawInput;
}
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
@@ -754,10 +756,18 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
{
window->lockKeyMods = value ? true : false;
}
else if (mode == GLFW_RAW_INPUT)
_glfwPlatformSetRawInput(window, value ? true : false);
else
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
}
GLFWAPI int glfwRawInputSupported(void)
{
_GLFW_REQUIRE_INIT_OR_RETURN(0);
return _glfwPlatformRawInputSupported();
}
GLFWAPI const char* glfwGetKeyName(int key, int native_key)
{
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);