mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Document that checking XButton1 and XButton2 state on X11 is not supported
This commit is contained in:
parent
c1064bae92
commit
0310b03aef
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user