mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
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:
committed by
Camilla Löwy
parent
5f9cbd0ebc
commit
9e29f556fd
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user