Wouldn't it be more uniform if SFML provided an enum for Joystick buttons like for mouse (sf::Mouse::Button) or keys (sf::Key::Code)? Maybe the enumerators don't carry meaningful names, but at least you would have more type safety than with plain unsigned ints.
I don't think that type safety is important here, a joystick button is just an index. An enum would be like JoyButton0, JoyButton1, ... and people would write complicated code because it wouldn't be clear that JoyButton0 == 0 etc. (or at least, it wouldn't be clear that it's a consistent thing they can rely on).
I noticed that when I wanted to write an overloaded function for my action event system. The joystick variant is far less expressive:
I thing the problem here is not the lack of an enum for joystick buttons, but rather too many implicit things in your API
I see two solutions to your problem:
1. defining your own enum for joystick buttons (they wouldn't be in namespace sf::, though)
2. making things a little more explicit:
thor::KeyAction keyAction(sf::Key::Y);
thor::MouseAction mouseAction(sf::Mouse::Left);
thor::JoystickAction joystickAction(0, 1); // (joystick number, button number)
And the other question: Why do some identifiers contain "Joy" and some "Joystick"? Don't you want to use "Joystick" throughout the library? (Meanwhile, you must hate me for this kind of question )
I absolutely hate this :mrgreen:
Using "Joystick" everywhere would of course be more consistent, but it produces really long lines of code
if ((event.Type == sf::JoystickMoved) && (event.JoystickMove.JoystickId == 0) && (event.JoystickMove.Axis == sf::Joystick::AxisPOV))
But I guess it's less important than a consistent API.