mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 13:32:01 +00:00
Added support for mouse buttons 4-n.
This commit is contained in:
parent
c93b120252
commit
57b8be1c24
@ -205,6 +205,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/).
|
||||
## Changelog
|
||||
|
||||
- [Win32] Bugfix: `_WIN32_WINNT` was not set to Windows XP or later
|
||||
- [X11] Bugfix: Events for mouse buttons 4 and above were not reported
|
||||
|
||||
|
||||
## Contact
|
||||
|
@ -553,6 +553,16 @@ static void processEvent(XEvent *event)
|
||||
else if (event->xbutton.button == Button7)
|
||||
_glfwInputScroll(window, 1.0, 0.0);
|
||||
|
||||
else
|
||||
{
|
||||
// Additional buttons after 7 are treated as regular buttons
|
||||
// We subtract 4 to fill the gap left by scroll input above
|
||||
_glfwInputMouseClick(window,
|
||||
event->xbutton.button - 4,
|
||||
GLFW_PRESS,
|
||||
mods);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -581,6 +591,15 @@ static void processEvent(XEvent *event)
|
||||
GLFW_RELEASE,
|
||||
mods);
|
||||
}
|
||||
else if (event->xbutton.button > Button7)
|
||||
{
|
||||
// Additional buttons after 7 are treated as regular buttons
|
||||
// We subtract 4 to fill the gap left by scroll input above
|
||||
_glfwInputMouseClick(window,
|
||||
event->xbutton.button - 4,
|
||||
GLFW_RELEASE,
|
||||
mods);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user