{"action":"created","comment":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/comments/31386076","id":31386076,"diff_hunk":"@@ -0,0 +1,57 @@\n+// Copyright 2015 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 <SDL2/SDL.h>\n+#include <iostream>\n+#include \"input_common/input_common.h\"\n+\n+namespace InputCommon {\n+\n+class SDLController final : public ControllerBase {\n+public:\n+    SDLController();\n+    ~SDLController();\n+\n+    /// Initializes input via SDL2\n+    bool Init() override;\n+\n+    /// Grabs a list of devices supported by the backend\n+    void DiscoverDevices() override;\n+\n+    /// Grab and process input via SDL2\n+    void Poll() override;\n+\n+    /// Shuts down all joysticks opened by SDL2\n+    void Shutdown() override;\n+\n+    /// Processes input when polling\n+    void ProcessInput();\n+\n+    /// Sets up keymaps from input configuration\n+    void SetupKeyMaps();\n+\n+    /// Sets analog deadzones\n+    void SetDeadZone(int range);\n+\n+    /// Checks if analog input is within the dead zone\n+    bool CheckDeadZone(int range);","path":"src/input_common/sdl_input/sdl_input.h","position":40,"original_position":40,"commit_id":"3814e608154c32915431a66055f266848e7f3c2d","original_commit_id":"3814e608154c32915431a66055f266848e7f3c2d","user":{"login":"lioncash","id":712067,"avatar_url":"https://avatars.githubusercontent.com/u/712067?v=3","gravatar_id":"","url":"https://api.github.com/users/lioncash","html_url":"https://github.com/lioncash","followers_url":"https://api.github.com/users/lioncash/followers","following_url":"https://api.github.com/users/lioncash/following{/other_user}","gists_url":"https://api.github.com/users/lioncash/gists{/gist_id}","starred_url":"https://api.github.com/users/lioncash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lioncash/subscriptions","organizations_url":"https://api.github.com/users/lioncash/orgs","repos_url":"https://api.github.com/users/lioncash/repos","events_url":"https://api.github.com/users/lioncash/events{/privacy}","received_events_url":"https://api.github.com/users/lioncash/received_events","type":"User","site_admin":false},"body":"CheckDeadZone can be const.","created_at":"2015-05-31T01:57:53Z","updated_at":"2015-05-31T01:57:53Z","html_url":"https://github.com/citra-emu/citra/pull/836#discussion_r31386076","pull_request_url":"https://api.github.com/repos/citra-emu/citra/pulls/836","_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/comments/31386076"},"html":{"href":"https://github.com/citra-emu/citra/pull/836#discussion_r31386076"},"pull_request":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/836"}}},"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/836","id":36571735,"html_url":"https://github.com/citra-emu/citra/pull/836","diff_url":"https://github.com/citra-emu/citra/pull/836.diff","patch_url":"https://github.com/citra-emu/citra/pull/836.patch","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/836","number":836,"state":"open","locked":false,"title":"InputCommon","user":{"login":"shonumi","id":7418176,"avatar_url":"https://avatars.githubusercontent.com/u/7418176?v=3","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"body":"The purpose of InputCommon is to centralize input handling from a single interface. It also abstracts the process to allow different backends (SDL, DInput, XInput) to write their own implementations. Currently only SDL has an implementation written here, but others can be added.\r\n\r\nPlease keep in mind that this represents basic work done towards getting InputCommon towards where it ideally needs to be. Emu_window still handles keyboard input for GLFW and Qt (this is something InputCommon should do), and there is no configuration just yet. For those brave enough to test controller support, the default is set to work with an XBOX 360 controller (Pretty much 1:1 A on 360 = A on the 3DS and so on).","created_at":"2015-05-30T20:44:28Z","updated_at":"2015-05-31T01:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f897e66eff2bb3efee647f53d394b0b095ad827","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/citra-emu/citra/pulls/836/commits","review_comments_url":"https://api.github.com/repos/citra-emu/citra/pulls/836/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/836/comments","statuses_url":"https://api.github.com/repos/citra-emu/citra/statuses/3814e608154c32915431a66055f266848e7f3c2d","head":{"label":"shonumi:input_common","ref":"input_common","sha":"3814e608154c32915431a66055f266848e7f3c2d","user":{"login":"shonumi","id":7418176,"avatar_url":"https://avatars.githubusercontent.com/u/7418176?v=3","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"repo":{"id":36151050,"name":"citra","full_name":"shonumi/citra","owner":{"login":"shonumi","id":7418176,"avatar_url":"https://avatars.githubusercontent.com/u/7418176?v=3","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shonumi/citra","description":"Nintendo 3DS emulator/debugger","fork":true,"url":"https://api.github.com/repos/shonumi/citra","forks_url":"https://api.github.com/repos/shonumi/citra/forks","keys_url":"https://api.github.com/repos/shonumi/citra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shonumi/citra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shonumi/citra/teams","hooks_url":"https://api.github.com/repos/shonumi/citra/hooks","issue_events_url":"https://api.github.com/repos/shonumi/citra/issues/events{/number}","events_url":"https://api.github.com/repos/shonumi/citra/events","assignees_url":"https://api.github.com/repos/shonumi/citra/assignees{/user}","branches_url":"https://api.github.com/repos/shonumi/citra/branches{/branch}","tags_url":"https://api.github.com/repos/shonumi/citra/tags","blobs_url":"https://api.github.com/repos/shonumi/citra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shonumi/citra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shonumi/citra/git/refs{/sha}","trees_url":"https://api.github.com/repos/shonumi/citra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shonumi/citra/statuses/{sha}","languages_url":"https://api.github.com/repos/shonumi/citra/languages","stargazers_url":"https://api.github.com/repos/shonumi/citra/stargazers","contributors_url":"https://api.github.com/repos/shonumi/citra/contributors","subscribers_url":"https://api.github.com/repos/shonumi/citra/subscribers","subscription_url":"https://api.github.com/repos/shonumi/citra/subscription","commits_url":"https://api.github.com/repos/shonumi/citra/commits{/sha}","git_commits_url":"https://api.github.com/repos/shonumi/citra/git/commits{/sha}","comments_url":"https://api.github.com/repos/shonumi/citra/comments{/number}","issue_comment_url":"https://api.github.com/repos/shonumi/citra/issues/comments{/number}","contents_url":"https://api.github.com/repos/shonumi/citra/contents/{+path}","compare_url":"https://api.github.com/repos/shonumi/citra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shonumi/citra/merges","archive_url":"https://api.github.com/repos/shonumi/citra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shonumi/citra/downloads","issues_url":"https://api.github.com/repos/shonumi/citra/issues{/number}","pulls_url":"https://api.github.com/repos/shonumi/citra/pulls{/number}","milestones_url":"https://api.github.com/repos/shonumi/citra/milestones{/number}","notifications_url":"https://api.github.com/repos/shonumi/citra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shonumi/citra/labels{/name}","releases_url":"https://api.github.com/repos/shonumi/citra/releases{/id}","created_at":"2015-05-24T01:49:19Z","updated_at":"2015-05-24T01:49:21Z","pushed_at":"2015-05-31T00:29:04Z","git_url":"git://github.com/shonumi/citra.git","ssh_url":"git@github.com:shonumi/citra.git","clone_url":"https://github.com/shonumi/citra.git","svn_url":"https://github.com/shonumi/citra","homepage":null,"size":8721,"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":"595fe49a8f69de5e6c0b6aad3f5a2a2e2b88a23e","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/debugger","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}","created_at":"2014-05-16T18:33:15Z","updated_at":"2015-05-30T22:11:21Z","pushed_at":"2015-05-31T00:29: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":null,"size":25514,"stargazers_count":871,"watchers_count":871,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":214,"mirror_url":null,"open_issues_count":69,"forks":214,"open_issues":69,"watchers":871,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/836"},"html":{"href":"https://github.com/citra-emu/citra/pull/836"},"issue":{"href":"https://api.github.com/repos/citra-emu/citra/issues/836"},"comments":{"href":"https://api.github.com/repos/citra-emu/citra/issues/836/comments"},"review_comments":{"href":"https://api.github.com/repos/citra-emu/citra/pulls/836/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/836/commits"},"statuses":{"href":"https://api.github.com/repos/citra-emu/citra/statuses/3814e608154c32915431a66055f266848e7f3c2d"}}}}