Added two-dimensional scrolling API and X11 implementation.

This commit is contained in:
Camilla Berglund
2010-09-27 02:09:54 +02:00
parent 9fc3fe644b
commit 007766bd91
7 changed files with 58 additions and 46 deletions
+16 -1
View File
@@ -91,7 +91,8 @@ void clearInputState(_GLFWwindow* window)
window->mousePosY = 0;
// Set mouse wheel position to 0
window->wheelPos = 0;
window->scrollX = 0;
window->scrollY = 0;
// The default is to use non sticky keys and mouse buttons
window->stickyKeys = GL_FALSE;
@@ -163,6 +164,20 @@ void _glfwInputChar(_GLFWwindow* window, int character)
}
//========================================================================
// Register scroll events
//========================================================================
void _glfwInputScroll(_GLFWwindow* window, int x, int y)
{
window->scrollX += x;
window->scrollY += y;
if (window->scrollCallback)
window->scrollCallback(window, x, y);
}
//========================================================================
// Register mouse button clicks
//========================================================================