diff --git a/include/SFML/Window/Mouse.hpp b/include/SFML/Window/Mouse.hpp index 10cfa5ff7..13d280cbf 100644 --- a/include/SFML/Window/Mouse.hpp +++ b/include/SFML/Window/Mouse.hpp @@ -72,6 +72,9 @@ public: //////////////////////////////////////////////////////////// /// \brief Check if a mouse button is pressed /// + /// \warning Checking the state of buttons Mouse::XButton1 and + /// Mouse::XButton2 is not supported on Linux with X11. + /// /// \param button Button to check /// /// \return True if the button is pressed, false otherwise diff --git a/src/SFML/Window/Unix/InputImpl.cpp b/src/SFML/Window/Unix/InputImpl.cpp index aaf450413..dc0f38203 100644 --- a/src/SFML/Window/Unix/InputImpl.cpp +++ b/src/SFML/Window/Unix/InputImpl.cpp @@ -202,6 +202,9 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button) // Close the connection with the X server CloseDisplay(display); + // Buttons 4 and 5 are the vertical wheel and 6 and 7 the horizontal wheel. + // There is no mask for buttons 8 and 9, so checking the state of buttons + // Mouse::XButton1 and Mouse::XButton2 is not supported. switch (button) { case Mouse::Left: return buttons & Button1Mask; diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index fb2a6ff77..ef8e93e70 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -2020,8 +2020,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent) // Mouse button pressed case ButtonPress: { - // XXX: Why button 8 and 9? - // Because 4 and 5 are the vertical wheel and 6 and 7 are horizontal wheel ;) + // Buttons 4 and 5 are the vertical wheel and 6 and 7 the horizontal wheel. unsigned int button = windowEvent.xbutton.button; if ((button == Button1) || (button == Button2) ||