diff --git a/README.md b/README.md index 0a8854ae..f24de6a1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/x11_window.c b/src/x11_window.c index 33c4b8e4..f0e872e4 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -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; }