{"action":"closed","issue":{"url":"https://api.github.com/repos/RPi-Distro/python-sense-hat/issues/9","labels_url":"https://api.github.com/repos/RPi-Distro/python-sense-hat/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/RPi-Distro/python-sense-hat/issues/9/comments","events_url":"https://api.github.com/repos/RPi-Distro/python-sense-hat/issues/9/events","html_url":"https://github.com/RPi-Distro/python-sense-hat/issues/9","id":107990093,"number":9,"title":"Example pygame_joystick.py does not  run headless, use python_evdev instead of pygame","user":{"login":"tvoverbeek","id":1197294,"avatar_url":"https://avatars.githubusercontent.com/u/1197294?v=3","gravatar_id":"","url":"https://api.github.com/users/tvoverbeek","html_url":"https://github.com/tvoverbeek","followers_url":"https://api.github.com/users/tvoverbeek/followers","following_url":"https://api.github.com/users/tvoverbeek/following{/other_user}","gists_url":"https://api.github.com/users/tvoverbeek/gists{/gist_id}","starred_url":"https://api.github.com/users/tvoverbeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvoverbeek/subscriptions","organizations_url":"https://api.github.com/users/tvoverbeek/orgs","repos_url":"https://api.github.com/users/tvoverbeek/repos","events_url":"https://api.github.com/users/tvoverbeek/events{/privacy}","received_events_url":"https://api.github.com/users/tvoverbeek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-23T19:31:09Z","updated_at":"2015-10-05T08:34:31Z","closed_at":"2015-10-05T08:34:31Z","body":"The pygame_joystick example needs a display otherwise the event loop does not work.\r\nThis is a problem when running headless (e.g. RPi with Sense Hat accessed via ssh).\r\nAlso the display is initialized with size 640x480 which is not nice to the new Raspberry Pi Display (800x400).\r\n\r\nYou can get it to work headless with 'hdmi_force_hotplug=1'  in /boot/config.txt.\r\nHowever the ESC key will not be recognized via ssh. You have to terminate with Ctrl-C\r\n\r\nThe code only needs keyboard events, so a display should not be needed.\r\nI wrote an evdev_joystick.py using the same logic as pygame_joystick.\r\nIf you are interested I can generate a pull request with my added evdev_joystick.py.\r\nOf course, instructions will have to be added how to install python_evdev.\r\n"}}