Document that checking XButton1 and XButton2 state on X11 is not supported

This commit is contained in:
kimci86 2022-11-13 15:08:00 +01:00 committed by Lukas Dürrenberger
parent c1064bae92
commit 0310b03aef
3 changed files with 7 additions and 2 deletions

View File

@ -72,6 +72,9 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check if a mouse button is pressed /// \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 /// \param button Button to check
/// ///
/// \return True if the button is pressed, false otherwise /// \return True if the button is pressed, false otherwise

View File

@ -202,6 +202,9 @@ bool InputImpl::isMouseButtonPressed(Mouse::Button button)
// Close the connection with the X server // Close the connection with the X server
CloseDisplay(display); 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) switch (button)
{ {
case Mouse::Left: return buttons & Button1Mask; case Mouse::Left: return buttons & Button1Mask;

View File

@ -2020,8 +2020,7 @@ bool WindowImplX11::processEvent(XEvent& windowEvent)
// Mouse button pressed // Mouse button pressed
case ButtonPress: case ButtonPress:
{ {
// XXX: Why button 8 and 9? // Buttons 4 and 5 are the vertical wheel and 6 and 7 the horizontal wheel.
// Because 4 and 5 are the vertical wheel and 6 and 7 are horizontal wheel ;)
unsigned int button = windowEvent.xbutton.button; unsigned int button = windowEvent.xbutton.button;
if ((button == Button1) || if ((button == Button1) ||
(button == Button2) || (button == Button2) ||