Rename raw input to raw mouse motion, cleanup

From upstream: 1155c83013.
This commit is contained in:
Luflosi
2020-05-24 19:47:52 +02:00
parent 48fb051253
commit 55ad228166
9 changed files with 105 additions and 84 deletions

28
glfw/input.c vendored
View File

@@ -675,8 +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;
case GLFW_RAW_MOUSE_MOTION:
return window->rawMouseMotion;
}
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
@@ -756,16 +756,30 @@ 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 if (mode == GLFW_RAW_MOUSE_MOTION)
{
if (!_glfwPlatformRawMouseMotionSupported())
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Raw mouse motion is not supported on this system");
return;
}
value = value ? true : false;
if (window->rawMouseMotion == value)
return;
window->rawMouseMotion = value;
_glfwPlatformSetRawMouseMotion(window, value);
}
else
_glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode);
}
GLFWAPI int glfwRawInputSupported(void)
GLFWAPI int glfwRawMouseMotionSupported(void)
{
_GLFW_REQUIRE_INIT_OR_RETURN(0);
return _glfwPlatformRawInputSupported();
_GLFW_REQUIRE_INIT_OR_RETURN(false);
return _glfwPlatformRawMouseMotionSupported();
}
GLFWAPI const char* glfwGetKeyName(int key, int native_key)