Skip to content

Commit

Permalink
toggle raw input IF SUPPORTED
Browse files Browse the repository at this point in the history
  • Loading branch information
serg06 committed Jan 12, 2020
1 parent 660f6e0 commit 1b25323
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,10 @@ void App::onKey(GLFWwindow* window, int key, int scancode, int action, int mods)

// R = toggle raw input
if (key == GLFW_KEY_R) {
const bool raw_motion = glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION);
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, !raw_motion);
if (glfwRawMouseMotionSupported()) {
const bool raw_motion = glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION);
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, !raw_motion);
}
}
}

Expand Down

0 comments on commit 1b25323

Please sign in to comment.