{"action":"created","issue":{"url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/242","repository_url":"https://api.github.com/repos/UltraStar-Deluxe/USDX","labels_url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/242/comments","events_url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/242/events","html_url":"https://github.com/UltraStar-Deluxe/USDX/issues/242","id":210234414,"number":242,"title":"Controller input for Menu and Random does not work","user":{"login":"RattleSN4K3","id":6833006,"avatar_url":"https://avatars.githubusercontent.com/u/6833006?v=3","gravatar_id":"","url":"https://api.github.com/users/RattleSN4K3","html_url":"https://github.com/RattleSN4K3","followers_url":"https://api.github.com/users/RattleSN4K3/followers","following_url":"https://api.github.com/users/RattleSN4K3/following{/other_user}","gists_url":"https://api.github.com/users/RattleSN4K3/gists{/gist_id}","starred_url":"https://api.github.com/users/RattleSN4K3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RattleSN4K3/subscriptions","organizations_url":"https://api.github.com/users/RattleSN4K3/orgs","repos_url":"https://api.github.com/users/RattleSN4K3/repos","events_url":"https://api.github.com/users/RattleSN4K3/events{/privacy}","received_events_url":"https://api.github.com/users/RattleSN4K3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-25T13:23:45Z","updated_at":"2017-02-25T13:24:35Z","closed_at":null,"body":"As of code changes from #240, the controller input which simulates keyboard input is not working anymore. This includes button presses for random song selection and opening the menu which are handled by character inputs (on key down) of [M] and [R] (the only ones which are currently mapped).\r\n\r\nDue to the pull request being closed I gonna quote the reply from there here as well.\r\n\r\n> Is there a reason why you removed the following code?\r\n> ```\r\n>            // TODO: hacky workaround for enabling keyboard simulation of controllers. use SDL2 new input handling SDL_StartTextInput and SDL_StopTextInput(\r\n>            else if Event.key.keysym.unicode = 0 then\r\n>            begin\r\n>              s1 := SDL_GetScancodeName(Event.key.keysym.scancode);\r\n>              if Length(s1) = 1 then KeyCharUnicode := Ord(s1[1])\r\n>            end;\r\n>```\r\n>\r\n>That specific code was required for simulating keyboard input from controllers (such as [M] for menu and [R] for random).\r\n>\r\n>If that code was the reason of the duplicated letters, I agree there should have been a double check, but removing that code and removing that feature shouldn't have been done.\r\n>```\r\n>            else if (Event.type_ <> SDL_TEXTINPUT) and (Event.key.keysym.unicode = 0) then\r\n>```\r\n>\r\n>That code part specifically translates SLD key input (in form of TSDL_ScanCode converted from TSDL_KeyCode) to a KeyCharUnicode representation like how the rest of the USDX code is expecting.\r\n\r\n\r\nWho ever did test the issue on duplicate letters and being able to reproduce the issues, could test by keeping that specific code part in with the small changes to the input handling. I am not sure if reverting or adding that double check is sufficient.\r\n"},"comment":{"url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/comments/282483808","html_url":"https://github.com/UltraStar-Deluxe/USDX/issues/242#issuecomment-282483808","issue_url":"https://api.github.com/repos/UltraStar-Deluxe/USDX/issues/242","id":282483808,"user":{"login":"basisbit","id":10870269,"avatar_url":"https://avatars.githubusercontent.com/u/10870269?v=3","gravatar_id":"","url":"https://api.github.com/users/basisbit","html_url":"https://github.com/basisbit","followers_url":"https://api.github.com/users/basisbit/followers","following_url":"https://api.github.com/users/basisbit/following{/other_user}","gists_url":"https://api.github.com/users/basisbit/gists{/gist_id}","starred_url":"https://api.github.com/users/basisbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basisbit/subscriptions","organizations_url":"https://api.github.com/users/basisbit/orgs","repos_url":"https://api.github.com/users/basisbit/repos","events_url":"https://api.github.com/users/basisbit/events{/privacy}","received_events_url":"https://api.github.com/users/basisbit/received_events","type":"User","site_admin":false},"created_at":"2017-02-25T13:24:35Z","updated_at":"2017-02-25T13:24:35Z","body":"Event.key.keysym.unicode is deprecated and does not work correctly any more in some builds of SDL 2.0.5. If SDL_GetScancodeName is required, then that should be done already before the keypress is simulated. Or are those keys actually KeyPresses without causing the SDL_CONTROLLER/JoypadBUTTONDOWN event?"}}
{"actor":{"display_login":"basisbit"}}