Add GLFW_RAW_INPUT and glfwRawInputSupported

This adds runtime per-window control of whether accelerated or raw mouse
motion is provided when the cursor is disabled.

Fixes #1400.
Closes #1401.
This commit is contained in:
Nathan Poirier
2018-12-14 03:08:25 +01:00
committed by Camilla Löwy
parent 5f9cbd0ebc
commit 9e29f556fd
11 changed files with 157 additions and 14 deletions

View File

@@ -163,6 +163,19 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
printf("(( cursor is hidden ))\n");
break;
case GLFW_KEY_R:
if (glfwGetInputMode(window, GLFW_RAW_INPUT))
{
glfwSetInputMode(window, GLFW_RAW_INPUT, GLFW_FALSE);
printf("(( raw input is disabled ))\n");
}
else
{
glfwSetInputMode(window, GLFW_RAW_INPUT, GLFW_TRUE);
printf("(( raw input is enabled ))\n");
}
break;
case GLFW_KEY_SPACE:
swap_interval = 1 - swap_interval;
printf("(( swap interval: %i ))\n", swap_interval);