{"action":"created","issue":{"url":"https://api.github.com/repos/SFML/SFML/issues/1292","repository_url":"https://api.github.com/repos/SFML/SFML","labels_url":"https://api.github.com/repos/SFML/SFML/issues/1292/labels{/name}","comments_url":"https://api.github.com/repos/SFML/SFML/issues/1292/comments","events_url":"https://api.github.com/repos/SFML/SFML/issues/1292/events","html_url":"https://github.com/SFML/SFML/issues/1292","id":260705777,"number":1292,"title":"sf::Joystick::PovY is inverted on Linux","user":{"login":"naezith","id":6732486,"avatar_url":"https://avatars3.githubusercontent.com/u/6732486?v=4","gravatar_id":"","url":"https://api.github.com/users/naezith","html_url":"https://github.com/naezith","followers_url":"https://api.github.com/users/naezith/followers","following_url":"https://api.github.com/users/naezith/following{/other_user}","gists_url":"https://api.github.com/users/naezith/gists{/gist_id}","starred_url":"https://api.github.com/users/naezith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naezith/subscriptions","organizations_url":"https://api.github.com/users/naezith/orgs","repos_url":"https://api.github.com/users/naezith/repos","events_url":"https://api.github.com/users/naezith/events{/privacy}","received_events_url":"https://api.github.com/users/naezith/received_events","type":"User","site_admin":false},"labels":[{"id":85849,"url":"https://api.github.com/repos/SFML/SFML/labels/bug","name":"bug","color":"ff4242","default":true},{"id":85855,"url":"https://api.github.com/repos/SFML/SFML/labels/m:sfml-window","name":"m:sfml-window","color":"cccccc","default":false},{"id":100768202,"url":"https://api.github.com/repos/SFML/SFML/labels/p:linux","name":"p:linux","color":"888888","default":false},{"id":87275,"url":"https://api.github.com/repos/SFML/SFML/labels/s:undecided","name":"s:undecided","color":"ffe20a","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-09-26T17:25:58Z","updated_at":"2018-02-22T09:55:31Z","closed_at":null,"author_association":"NONE","body":"`sf::Joystick::PovY` is coming inverted compared to Windows. It is same for `sf::Event::JoystickMoveEvent` and `sf::Joystick::getAxisPosition(joystickId, sf::Joystick::PovY)`.\r\n\r\nI press Up at D-pad, on Windows I get 100, on Linux I get -100.\r\nAnalog Stick (sf::Joystick::Y) works fine on the other hand.\r\n\r\nI can write OS-dependent code and just invert the value but that would be the only OS-dependent code in my big project.\r\n\r\n```cpp\r\n#include <SFML/Graphics.hpp>\r\n#include <iostream>\r\n\r\nint main() {\r\n    sf::RenderWindow window;\r\n    window.create(sf::VideoMode::getDesktopMode(), \"Inverted PovY\", sf::Style::Default);\r\n\r\n    while(window.isOpen()) {\r\n        sf::Event event;\r\n        while(window.pollEvent(event)) {\r\n            if(event.type == sf::Event::Closed) window.close();\r\n            else if(event.type == sf::Event::JoystickMoved && event.joystickMove.axis == sf::Joystick::PovY)\r\n                std::cout << event.joystickMove.position << std::endl;\r\n        }\r\n\r\n        std::cout << sf::Joystick::getAxisPosition(0, sf::Joystick::PovY) << std::endl;\r\n\r\n        window.clear(sf::Color::Red);\r\n        window.display();\r\n    }\r\n\r\n    return 0;\r\n}\r\n```\r\n\r\n**Logitech F310 Gamepad\r\nLinux (Ubuntu 16.04), SFML 2.4.2**"},"comment":{"url":"https://api.github.com/repos/SFML/SFML/issues/comments/367627648","html_url":"https://github.com/SFML/SFML/issues/1292#issuecomment-367627648","issue_url":"https://api.github.com/repos/SFML/SFML/issues/1292","id":367627648,"user":{"login":"eliasdaler","id":1285136,"avatar_url":"https://avatars0.githubusercontent.com/u/1285136?v=4","gravatar_id":"","url":"https://api.github.com/users/eliasdaler","html_url":"https://github.com/eliasdaler","followers_url":"https://api.github.com/users/eliasdaler/followers","following_url":"https://api.github.com/users/eliasdaler/following{/other_user}","gists_url":"https://api.github.com/users/eliasdaler/gists{/gist_id}","starred_url":"https://api.github.com/users/eliasdaler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliasdaler/subscriptions","organizations_url":"https://api.github.com/users/eliasdaler/orgs","repos_url":"https://api.github.com/users/eliasdaler/repos","events_url":"https://api.github.com/users/eliasdaler/events{/privacy}","received_events_url":"https://api.github.com/users/eliasdaler/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T09:55:31Z","updated_at":"2018-02-22T09:55:31Z","author_association":"NONE","body":"Hmm, it also looks like wireless controllers on Linux don't even support axes for d-pad... (looks like driver limitation) Can anyone with a wireless gamepad test it? (e.g. by using `jtest /dev/input/js0`).\r\n\r\nAnd I have no idea how Mac treats D-pad axes by default. Can anyone test it too, please?"}}
{"actor":{"display_login":"eliasdaler"}}