{"action":"created","comment":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/comments/73966850","id":73966850,"diff_hunk":"@@ -0,0 +1,57 @@\n+// Copyright 2016 Citra Emulator Project\n+// Licensed under GPLv2 or any later version\n+// Refer to the license.txt file included.\n+\n+#pragma once\n+\n+#include <SDL_gamecontroller.h>\n+\n+#include \"input_core/devices/device.h\"\n+\n+class SDLGamepad : public IDevice {\n+public:\n+    SDLGamepad();\n+    SDLGamepad(int number_, SDL_GameController* gamepad_);\n+    ~SDLGamepad();\n+\n+    bool InitDevice(int number, const std::map<std::string, std::vector<Service::HID::PadState>>& keyMap) override;\n+    void ProcessInput() override;\n+    bool CloseDevice() override;\n+    Settings::InputDeviceMapping GetInput() override;\n+    void Clear() override;\n+\n+    ///Returns vector of all gamepads connected to computer. Used for keybinding setup\n+    static std::vector<std::shared_ptr<IDevice>> GetAllDevices();\n+private:\n+    /// Maps the friendly name shown on GUI with the string name for getting the SDL button instance.\n+    std::map<std::string, std::string> friendly_name_mapping = {\n+        { \"Button A\",\"a\" },\n+        { \"Button B\",\"b\" },\n+        { \"Button X\",\"x\" },","path":"src/input_core/devices/sdl_gamepad.h","position":30,"original_position":30,"commit_id":"dd9d90c5d7227d8eedebc814af3d4c689e8a0668","original_commit_id":"dd9d90c5d7227d8eedebc814af3d4c689e8a0668","user":{"login":"makotech222","id":4389156,"avatar_url":"https://avatars.githubusercontent.com/u/4389156?v=3","gravatar_id":"","url":"https://api.github.com/users/makotech222","html_url":"https://github.com/makotech222","followers_url":"https://api.github.com/users/makotech222/followers","following_url":"https://api.github.com/users/makotech222/following{/other_user}","gists_url":"https://api.github.com/users/makotech222/gists{/gist_id}","starred_url":"https://api.github.com/users/makotech222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makotech222/subscriptions","organizations_url":"https://api.github.com/users/makotech222/orgs","repos_url":"https://api.github.com/users/makotech222/repos","events_url":"https://api.github.com/users/makotech222/events{/privacy}","received_events_url":"https://api.github.com/users/makotech222/received_events","type":"User","site_admin":false},"body":"Okay i reread how translations are handled, and I see what you mean. I will think of a different way to handle it.\r\n\r\nRegarding the friendly name string, i don't see why they wouldn't be the same for config entry and GUI text. It seems logical to me. If they were different, what would they be?","created_at":"2016-08-08T22:21:24Z","updated_at":"2016-08-08T22:21:25Z","html_url":"https://github.com/citra-emu/citra/pull/1995#discussion_r73966850","pull_request_url":"https://api.github.com/repos/citra-emu/citra/pulls/1995","_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments/73966850"},"html":{"href":"https://github.com/citra-emu/citra/pull/1995#discussion_r73966850"},"pull_request":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/1995"}}},"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/1995","id":80385240,"html_url":"https://github.com/citra-emu/citra/pull/1995","diff_url":"https://github.com/citra-emu/citra/pull/1995.diff","patch_url":"https://github.com/citra-emu/citra/pull/1995.patch","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/1995","number":1995,"state":"open","locked":false,"title":"Overhaul Input handling into InputCore. Add Gamepad support.","user":{"login":"makotech222","id":4389156,"avatar_url":"https://avatars.githubusercontent.com/u/4389156?v=3","gravatar_id":"","url":"https://api.github.com/users/makotech222","html_url":"https://github.com/makotech222","followers_url":"https://api.github.com/users/makotech222/followers","following_url":"https://api.github.com/users/makotech222/following{/other_user}","gists_url":"https://api.github.com/users/makotech222/gists{/gist_id}","starred_url":"https://api.github.com/users/makotech222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makotech222/subscriptions","organizations_url":"https://api.github.com/users/makotech222/orgs","repos_url":"https://api.github.com/users/makotech222/repos","events_url":"https://api.github.com/users/makotech222/events{/privacy}","received_events_url":"https://api.github.com/users/makotech222/received_events","type":"User","site_admin":false},"body":"Okay so this is pretty much the finished product. Description:\r\n\r\nThe code flows like so: First, settings are read from the respective settings file. The previous format for binding keys was just the QT/SDL value for each keyboard key. It now goes as follows:\r\n\r\npad_a=Framework/DeviceID/Device/Button\r\nExample:\r\npad_a=SDL/0/Gamepad/Button A\r\nor\r\npad_a=QT/0/Keyboard/70\r\n\r\nNote (QT and SDL keyboard are the same)\r\n\r\nThis pretty much copies how Dolphin does keybinding. From there, inputcore is initialized upon game starting, where it reads the settings values and initializes an IDevice object for each unique mapping. After initializing, input from SDL Gamepads are polled every tick, while keyboard input is still handled from the front end on an event basis. Touch screen input is also handled on front end on event basis.\r\n\r\nThis pull request as is, fixes\r\n~~#1707~~ (I had to reverse scan code change, due to way Qt handles scan codes. Will have to think of different solution)\r\n#1883 (partially, keyboard and touch screen input is now thread safe)\r\n\r\nSince the RFC, changes include:\r\n\r\n- Fixed Qt GUI key binding.\r\n- Keyboard now responds to Circle Pad Modifier key. Only works if bound to a keyboard key, though.\r\n- Touch screen input is now thread safe and handled by InputCore.\r\n\r\nI think in a future request, we may want to redo the Input GUI, since it needs to eventually handle HotKeys and a circle stick dead-zone setting.","created_at":"2016-08-08T01:42:40Z","updated_at":"2016-08-08T22:21:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"474781ace837739ae756b754ac8692004985e07f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/citra-emu/citra/pulls/1995/commits","review_comments_url":"https://api.github.com/repos/citra-emu/citra/pulls/1995/comments","review_comment_url":"https://api.github.com/repos/citra-emu/citra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/1995/comments","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/dd9d90c5d7227d8eedebc814af3d4c689e8a0668","head":{"label":"makotech222:inputcore","ref":"inputcore","sha":"dd9d90c5d7227d8eedebc814af3d4c689e8a0668","user":{"login":"makotech222","id":4389156,"avatar_url":"https://avatars.githubusercontent.com/u/4389156?v=3","gravatar_id":"","url":"https://api.github.com/users/makotech222","html_url":"https://github.com/makotech222","followers_url":"https://api.github.com/users/makotech222/followers","following_url":"https://api.github.com/users/makotech222/following{/other_user}","gists_url":"https://api.github.com/users/makotech222/gists{/gist_id}","starred_url":"https://api.github.com/users/makotech222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makotech222/subscriptions","organizations_url":"https://api.github.com/users/makotech222/orgs","repos_url":"https://api.github.com/users/makotech222/repos","events_url":"https://api.github.com/users/makotech222/events{/privacy}","received_events_url":"https://api.github.com/users/makotech222/received_events","type":"User","site_admin":false},"repo":{"id":57228456,"name":"citra","full_name":"makotech222/citra","owner":{"login":"makotech222","id":4389156,"avatar_url":"https://avatars.githubusercontent.com/u/4389156?v=3","gravatar_id":"","url":"https://api.github.com/users/makotech222","html_url":"https://github.com/makotech222","followers_url":"https://api.github.com/users/makotech222/followers","following_url":"https://api.github.com/users/makotech222/following{/other_user}","gists_url":"https://api.github.com/users/makotech222/gists{/gist_id}","starred_url":"https://api.github.com/users/makotech222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makotech222/subscriptions","organizations_url":"https://api.github.com/users/makotech222/orgs","repos_url":"https://api.github.com/users/makotech222/repos","events_url":"https://api.github.com/users/makotech222/events{/privacy}","received_events_url":"https://api.github.com/users/makotech222/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/makotech222/citra","description":"Nintendo 3DS Emulator","fork":true,"url":"https://api.github.com/repos/makotech222/citra","forks_url":"https://api.github.com/repos/makotech222/citra/forks","keys_url":"https://api.github.com/repos/makotech222/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makotech222/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makotech222/citra/teams","hooks_url":"https://api.github.com/repos/makotech222/citra/hooks","issue_events_url":"https://api.github.com/repos/makotech222/citra/issues/events{/number}","events_url":"https://api.github.com/repos/makotech222/citra/events","assignees_url":"https://api.github.com/repos/makotech222/citra/assignees{/user}","branches_url":"https://api.github.com/repos/makotech222/citra/branches{/branch}","tags_url":"https://api.github.com/repos/makotech222/citra/tags","blobs_url":"https://api.github.com/repos/makotech222/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makotech222/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makotech222/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/makotech222/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makotech222/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/makotech222/citra/languages","stargazers_url":"https://api.github.com/repos/makotech222/citra/stargazers","contributors_url":"https://api.github.com/repos/makotech222/citra/contributors","subscribers_url":"https://api.github.com/repos/makotech222/citra/subscribers","subscription_url":"https://api.github.com/repos/makotech222/citra/subscription","commits_url":"https://api.github.com/repos/makotech222/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/makotech222/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/makotech222/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/makotech222/citra/issues/comments{/number}","contents_url":"https://api.github.com/repos/makotech222/citra/contents/{+path}","compare_url":"https://api.github.com/repos/makotech222/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makotech222/citra/merges","archive_url":"https://api.github.com/repos/makotech222/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makotech222/citra/downloads","issues_url":"https://api.github.com/repos/makotech222/citra/issues{/number}","pulls_url":"https://api.github.com/repos/makotech222/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/makotech222/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/makotech222/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makotech222/citra/labels{/name}","releases_url":"https://api.github.com/repos/makotech222/citra/releases{/id}","deployments_url":"https://api.github.com/repos/makotech222/citra/deployments","created_at":"2016-04-27T16:23:43Z","updated_at":"2016-04-27T16:23:44Z","pushed_at":"2016-08-08T01:31:56Z","git_url":"git://github.com/makotech222/citra.git","ssh_url":"git@github.com:makotech222/citra.git","clone_url":"https://github.com/makotech222/citra.git","svn_url":"https://github.com/makotech222/citra","homepage":"https://citra-emu.org","size":13198,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"citra-emu:master","ref":"master","sha":"e91327c86a863b9419fd3695b2400a52336ec3b5","user":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"repo":{"id":19866730,"name":"citra","full_name":"citra-emu/citra","owner":{"login":"citra-emu","id":7605670,"avatar_url":"https://avatars.githubusercontent.com/u/7605670?v=3","gravatar_id":"","url":"https://api.github.com/users/citra-emu","html_url":"https://github.com/citra-emu","followers_url":"https://api.github.com/users/citra-emu/followers","following_url":"https://api.github.com/users/citra-emu/following{/other_user}","gists_url":"https://api.github.com/users/citra-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/citra-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citra-emu/subscriptions","organizations_url":"https://api.github.com/users/citra-emu/orgs","repos_url":"https://api.github.com/users/citra-emu/repos","events_url":"https://api.github.com/users/citra-emu/events{/privacy}","received_events_url":"https://api.github.com/users/citra-emu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/citra-emu/citra","description":"Nintendo 3DS Emulator","fork":false,"url":"https://api.github.com/repos/citra-emu/citra","forks_url":"https://api.github.com/repos/citra-emu/citra/forks","keys_url":"https://api.github.com/repos/citra-emu/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citra-emu/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citra-emu/citra/teams","hooks_url":"https://api.github.com/repos/citra-emu/citra/hooks","issue_events_url":"https://api.github.com/repos/citra-emu/citra/issues/events{/number}","events_url":"https://api.github.com/repos/citra-emu/citra/events","assignees_url":"https://api.github.com/repos/citra-emu/citra/assignees{/user}","branches_url":"https://api.github.com/repos/citra-emu/citra/branches{/branch}","tags_url":"https://api.github.com/repos/citra-emu/citra/tags","blobs_url":"https://api.github.com/repos/citra-emu/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citra-emu/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citra-emu/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/citra-emu/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/citra-emu/citra/languages","stargazers_url":"https://api.github.com/repos/citra-emu/citra/stargazers","contributors_url":"https://api.github.com/repos/citra-emu/citra/contributors","subscribers_url":"https://api.github.com/repos/citra-emu/citra/subscribers","subscription_url":"https://api.github.com/repos/citra-emu/citra/subscription","commits_url":"https://api.github.com/repos/citra-emu/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/citra-emu/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/citra-emu/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/citra-emu/citra/issues/comments{/number}","contents_url":"https://api.github.com/repos/citra-emu/citra/contents/{+path}","compare_url":"https://api.github.com/repos/citra-emu/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citra-emu/citra/merges","archive_url":"https://api.github.com/repos/citra-emu/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citra-emu/citra/downloads","issues_url":"https://api.github.com/repos/citra-emu/citra/issues{/number}","pulls_url":"https://api.github.com/repos/citra-emu/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/citra-emu/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/citra-emu/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citra-emu/citra/labels{/name}","releases_url":"https://api.github.com/repos/citra-emu/citra/releases{/id}","deployments_url":"https://api.github.com/repos/citra-emu/citra/deployments","created_at":"2014-05-16T18:33:15Z","updated_at":"2016-08-08T07:58:32Z","pushed_at":"2016-08-08T14:52:05Z","git_url":"git://github.com/citra-emu/citra.git","ssh_url":"git@github.com:citra-emu/citra.git","clone_url":"https://github.com/citra-emu/citra.git","svn_url":"https://github.com/citra-emu/citra","homepage":"https://citra-emu.org","size":21118,"stargazers_count":2164,"watchers_count":2164,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":536,"mirror_url":null,"open_issues_count":193,"forks":536,"open_issues":193,"watchers":2164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/1995"},"html":{"href":"https://github.com/citra-emu/citra/pull/1995"},"issue":{"href":"https://api.github.com/repos/citra-emu/citra/issues/1995"},"comments":{"href":"https://api.github.com/repos/citra-emu/citra/issues/1995/comments"},"review_comments":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/1995/comments"},"review_comment":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/1995/commits"},"statuses":{"href":"https://api.github.com/repos/citra-emu/citra/statuses/dd9d90c5d7227d8eedebc814af3d4c689e8a0668"}}}}
{"actor":{"display_login":"makotech222"}}