{"action":"created","issue":{"url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/12","repository_url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK","labels_url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/12/comments","events_url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/12/events","html_url":"https://github.com/OpenEmu/OpenEmu-SDK/pull/12","id":145317332,"number":12,"title":"Fix: hat switch buttons perform wrong actions on third-party controllers","user":{"login":"CharlesJS","id":1907560,"avatar_url":"https://avatars.githubusercontent.com/u/1907560?v=3","gravatar_id":"","url":"https://api.github.com/users/CharlesJS","html_url":"https://github.com/CharlesJS","followers_url":"https://api.github.com/users/CharlesJS/followers","following_url":"https://api.github.com/users/CharlesJS/following{/other_user}","gists_url":"https://api.github.com/users/CharlesJS/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlesJS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlesJS/subscriptions","organizations_url":"https://api.github.com/users/CharlesJS/orgs","repos_url":"https://api.github.com/users/CharlesJS/repos","events_url":"https://api.github.com/users/CharlesJS/events{/privacy}","received_events_url":"https://api.github.com/users/CharlesJS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-04-02T00:35:46Z","updated_at":"2016-05-25T22:19:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/pulls/12","html_url":"https://github.com/OpenEmu/OpenEmu-SDK/pull/12","diff_url":"https://github.com/OpenEmu/OpenEmu-SDK/pull/12.diff","patch_url":"https://github.com/OpenEmu/OpenEmu-SDK/pull/12.patch"},"body":"Hello,\r\n\r\nThis patch is to fix a regression in OpenEmu 2.0.1 which causes the button presses for the hat switch to be mapped to the incorrect virtual buttons. The issue is a little difficult to explain, and a video demonstrates it more clearly:\r\n\r\nhttp://charlessoft.com/extraneous_stuff/hat_switch_error.mp4\r\n\r\nBasically, there are multiple ways the hat switch can be configured, with the \"up\" button on the external controller possibly corresponding to \"up\" on the virtual D-pad, but these can also be out of sync, with \"up\" on the controller performing a \"down\" action in the emulator. Unfortunately, although this conceptual differentiation exists, it is not serialized, with the oedefaults file storing only a reference to the hat switch itself, rather than the direction of the event.\r\n\r\nI have fixed this simply by synchronizing the event with the key description whenever the controls for the hat switch are changed. Setting the hat switch as a control for the D-pad should always set the \"Up\" button on the controller as the \"Up\" button for the D-pad. The same check is done when deserializing the bindings from the file. This seems in line with the way other emulators work (Bannister's old emulators, for example, simply bind the D-pad directions to the hat switch rather than to specific directions on it).\r\n\r\nI've also added support for a few more HID pages. The main purpose of this was to enable the L2 and R2 buttons on my Moga Hero controller, which fall under kHIDPage_Simulation, but I've also enabled the VR, Sport, and Game pages, because they could conceivably be desirable for a game app such as this.\r\n\r\nI hope you find this useful."},"comment":{"url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/comments/221725093","html_url":"https://github.com/OpenEmu/OpenEmu-SDK/pull/12#issuecomment-221725093","issue_url":"https://api.github.com/repos/OpenEmu/OpenEmu-SDK/issues/12","id":221725093,"user":{"login":"clobber","id":1303132,"avatar_url":"https://avatars.githubusercontent.com/u/1303132?v=3","gravatar_id":"","url":"https://api.github.com/users/clobber","html_url":"https://github.com/clobber","followers_url":"https://api.github.com/users/clobber/followers","following_url":"https://api.github.com/users/clobber/following{/other_user}","gists_url":"https://api.github.com/users/clobber/gists{/gist_id}","starred_url":"https://api.github.com/users/clobber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clobber/subscriptions","organizations_url":"https://api.github.com/users/clobber/orgs","repos_url":"https://api.github.com/users/clobber/repos","events_url":"https://api.github.com/users/clobber/events{/privacy}","received_events_url":"https://api.github.com/users/clobber/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T22:19:21Z","updated_at":"2016-05-25T22:19:21Z","body":"Yep that did it - thanks! I think this is merge worthy now so expect the patch in OE 2.0.2"}}
{"actor":{"display_login":"clobber"}}