Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about XButton1 and 2 on X11. #2038

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/SFML/Window/Mouse.hpp
Expand Up @@ -53,8 +53,8 @@ class SFML_WINDOW_API Mouse
Left, //!< The left mouse button
Right, //!< The right mouse button
Middle, //!< The middle (wheel) mouse button
XButton1, //!< The first extra mouse button
XButton2, //!< The second extra mouse button
XButton1, //!< The first extra mouse button (not available on Linux)
XButton2, //!< The second extra mouse button (not available on Linux)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed out by @kimci86, these buttons are available through events, so I guess we might not want to have this here


ButtonCount //!< Keep last -- the total number of mouse buttons
};
Expand Down Expand Up @@ -172,6 +172,8 @@ class SFML_WINDOW_API Mouse
/// sf::Mouse::setPosition(sf::Vector2i(100, 200), window);
/// \endcode
///
/// \warning sf::Mouse::XButton1 and sf::Mouse::XButton2 are not available on Linux.
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed out by @kimci86, these buttons are available through events, so we might want to move this warning to isButtonPressed instead

/// \see sf::Joystick, sf::Keyboard, sf::Touch
///
////////////////////////////////////////////////////////////