mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Added two-dimensional scrolling API and X11 implementation.
This commit is contained in:
+16
-1
@@ -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
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user