{"action":"created","comment":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/77448679","id":77448679,"diff_hunk":"@@ -149,10 +150,21 @@ bool CPeripheral::Initialise(void)\n     return bReturn;\n \n   g_peripherals.GetSettingsFromMapping(*this);\n-  m_strSettingsFile = StringUtils::Format(\"special://profile/peripheral_data/%s_%s_%s.xml\",\n-                                          PeripheralTypeTranslator::BusTypeToString(m_mappedBusType),\n-                                          m_strVendorId.c_str(),\n-                                          m_strProductId.c_str());\n+  if (m_iVendorId == 0x0000 && m_iProductId == 0x0000)\n+  {\n+    m_strSettingsFile = StringUtils::Format(\"special://profile/peripheral_data/%s_%s.xml\",\n+                                            PeripheralTypeTranslator::BusTypeToString(m_mappedBusType),\n+                                            CUtil::MakeLegalFileName(m_strDeviceName, LEGAL_WIN32_COMPAT).c_str());\n+  }\n+  else\n+  {\n+    m_strSettingsFile = StringUtils::Format(\"special://profile/peripheral_data/%s_%s_%s_%s.xml\",\n+                                            PeripheralTypeTranslator::BusTypeToString(m_mappedBusType),\n+                                            m_strVendorId.c_str(),\n+                                            m_strProductId.c_str(),\n+                                            CUtil::MakeLegalFileName(m_strDeviceName, LEGAL_WIN32_COMPAT).c_str());","path":"xbmc/peripherals/devices/Peripheral.cpp","position":28,"original_position":28,"commit_id":"c4b6eb3ead4417c7f1414171be55822523c81dfd","original_commit_id":"c4b6eb3ead4417c7f1414171be55822523c81dfd","user":{"login":"MilhouseVH","id":805038,"avatar_url":"https://avatars.githubusercontent.com/u/805038?v=3","gravatar_id":"","url":"https://api.github.com/users/MilhouseVH","html_url":"https://github.com/MilhouseVH","followers_url":"https://api.github.com/users/MilhouseVH/followers","following_url":"https://api.github.com/users/MilhouseVH/following{/other_user}","gists_url":"https://api.github.com/users/MilhouseVH/gists{/gist_id}","starred_url":"https://api.github.com/users/MilhouseVH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MilhouseVH/subscriptions","organizations_url":"https://api.github.com/users/MilhouseVH/orgs","repos_url":"https://api.github.com/users/MilhouseVH/repos","events_url":"https://api.github.com/users/MilhouseVH/events{/privacy}","received_events_url":"https://api.github.com/users/MilhouseVH/received_events","type":"User","site_admin":false},"body":"PR: https://github.com/xbmc/xbmc/pull/10393\r\n\r\nUnfortunately `StringUtils::MakeSafeUrl()` doesn't exist in Kodi, so I've just used `StringUtils::Replace(... ' ', '_')` instead.","created_at":"2016-09-04T08:22:32Z","updated_at":"2016-09-04T08:22:32Z","html_url":"https://github.com/xbmc/xbmc/pull/10309#discussion_r77448679","pull_request_url":"https://api.github.com/repos/xbmc/xbmc/pulls/10309","_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments/77448679"},"html":{"href":"https://github.com/xbmc/xbmc/pull/10309#discussion_r77448679"},"pull_request":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/10309"}}},"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/10309","id":81904131,"html_url":"https://github.com/xbmc/xbmc/pull/10309","diff_url":"https://github.com/xbmc/xbmc/pull/10309.diff","patch_url":"https://github.com/xbmc/xbmc/pull/10309.patch","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/10309","number":10309,"state":"closed","locked":false,"title":"Deadzone settings","user":{"login":"garbear","id":531482,"avatar_url":"https://avatars.githubusercontent.com/u/531482?v=3","gravatar_id":"","url":"https://api.github.com/users/garbear","html_url":"https://github.com/garbear","followers_url":"https://api.github.com/users/garbear/followers","following_url":"https://api.github.com/users/garbear/following{/other_user}","gists_url":"https://api.github.com/users/garbear/gists{/gist_id}","starred_url":"https://api.github.com/users/garbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garbear/subscriptions","organizations_url":"https://api.github.com/users/garbear/orgs","repos_url":"https://api.github.com/users/garbear/repos","events_url":"https://api.github.com/users/garbear/events{/privacy}","received_events_url":"https://api.github.com/users/garbear/received_events","type":"User","site_admin":false},"body":"This PR promotes deadzone configuration to first-class peripheral settings. It adds the following settings to peripherals.xml:\r\n\r\n```xml\r\n<peripheral class=\"joystick\" mapTo=\"joystick\">\r\n    <setting key=\"left_stick_deadzone\" type=\"float\" label=\"35078\" order=\"1\" value=\"0.2\" min=\"0.0\" step=\"0.05\" max=\"1.0\" />\r\n    <setting key=\"right_stick_deadzone\" type=\"float\" label=\"35079\" order=\"2\" value=\"0.2\" min=\"0.0\" step=\"0.05\" max=\"1.0\" />\r\n</peripheral>\r\n```\r\n\r\nThe result is that all unique joysticks can have their own deadzone settings. (If two joystick have the same USB VID/PID, then they will have to share deadzone settings.) Additionally, there are separate settings for each analog stick.\r\n\r\n<img width=\"1460\" alt=\"deadzone setting\" src=\"https://cloud.githubusercontent.com/assets/531482/17793728/60fc408e-655e-11e6-84a9-1ec066395e1f.png\">","created_at":"2016-08-18T23:17:28Z","updated_at":"2016-09-04T08:22:32Z","closed_at":"2016-08-26T08:16:01Z","merged_at":"2016-08-26T08:16:01Z","merge_commit_sha":"a56be14886528adb567e0f0a1fc7a3c5a63c92f4","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/xbmc/xbmc/milestones/88","html_url":"https://github.com/xbmc/xbmc/milestones/Krypton%2017.0-beta2","labels_url":"https://api.github.com/repos/xbmc/xbmc/milestones/88/labels","id":1942882,"number":88,"title":"Krypton 17.0-beta2","description":"","creator":{"login":"MartijnKaijser","id":907436,"avatar_url":"https://avatars.githubusercontent.com/u/907436?v=3","gravatar_id":"","url":"https://api.github.com/users/MartijnKaijser","html_url":"https://github.com/MartijnKaijser","followers_url":"https://api.github.com/users/MartijnKaijser/followers","following_url":"https://api.github.com/users/MartijnKaijser/following{/other_user}","gists_url":"https://api.github.com/users/MartijnKaijser/gists{/gist_id}","starred_url":"https://api.github.com/users/MartijnKaijser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartijnKaijser/subscriptions","organizations_url":"https://api.github.com/users/MartijnKaijser/orgs","repos_url":"https://api.github.com/users/MartijnKaijser/repos","events_url":"https://api.github.com/users/MartijnKaijser/events{/privacy}","received_events_url":"https://api.github.com/users/MartijnKaijser/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":45,"state":"open","created_at":"2016-08-15T16:50:57Z","updated_at":"2016-09-04T06:32:45Z","due_on":"2016-08-31T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/xbmc/xbmc/pulls/10309/commits","review_comments_url":"https://api.github.com/repos/xbmc/xbmc/pulls/10309/comments","review_comment_url":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/10309/comments","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/c4b6eb3ead4417c7f1414171be55822523c81dfd","head":{"label":"garbear:deadzone-settings","ref":"deadzone-settings","sha":"c4b6eb3ead4417c7f1414171be55822523c81dfd","user":{"login":"garbear","id":531482,"avatar_url":"https://avatars.githubusercontent.com/u/531482?v=3","gravatar_id":"","url":"https://api.github.com/users/garbear","html_url":"https://github.com/garbear","followers_url":"https://api.github.com/users/garbear/followers","following_url":"https://api.github.com/users/garbear/following{/other_user}","gists_url":"https://api.github.com/users/garbear/gists{/gist_id}","starred_url":"https://api.github.com/users/garbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garbear/subscriptions","organizations_url":"https://api.github.com/users/garbear/orgs","repos_url":"https://api.github.com/users/garbear/repos","events_url":"https://api.github.com/users/garbear/events{/privacy}","received_events_url":"https://api.github.com/users/garbear/received_events","type":"User","site_admin":false},"repo":{"id":1593140,"name":"xbmc","full_name":"garbear/xbmc","owner":{"login":"garbear","id":531482,"avatar_url":"https://avatars.githubusercontent.com/u/531482?v=3","gravatar_id":"","url":"https://api.github.com/users/garbear","html_url":"https://github.com/garbear","followers_url":"https://api.github.com/users/garbear/followers","following_url":"https://api.github.com/users/garbear/following{/other_user}","gists_url":"https://api.github.com/users/garbear/gists{/gist_id}","starred_url":"https://api.github.com/users/garbear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garbear/subscriptions","organizations_url":"https://api.github.com/users/garbear/orgs","repos_url":"https://api.github.com/users/garbear/repos","events_url":"https://api.github.com/users/garbear/events{/privacy}","received_events_url":"https://api.github.com/users/garbear/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/garbear/xbmc","description":"XBMC Main Repository","fork":true,"url":"https://api.github.com/repos/garbear/xbmc","forks_url":"https://api.github.com/repos/garbear/xbmc/forks","keys_url":"https://api.github.com/repos/garbear/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garbear/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garbear/xbmc/teams","hooks_url":"https://api.github.com/repos/garbear/xbmc/hooks","issue_events_url":"https://api.github.com/repos/garbear/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/garbear/xbmc/events","assignees_url":"https://api.github.com/repos/garbear/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/garbear/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/garbear/xbmc/tags","blobs_url":"https://api.github.com/repos/garbear/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garbear/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garbear/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/garbear/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garbear/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/garbear/xbmc/languages","stargazers_url":"https://api.github.com/repos/garbear/xbmc/stargazers","contributors_url":"https://api.github.com/repos/garbear/xbmc/contributors","subscribers_url":"https://api.github.com/repos/garbear/xbmc/subscribers","subscription_url":"https://api.github.com/repos/garbear/xbmc/subscription","commits_url":"https://api.github.com/repos/garbear/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/garbear/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/garbear/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/garbear/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/garbear/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/garbear/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garbear/xbmc/merges","archive_url":"https://api.github.com/repos/garbear/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garbear/xbmc/downloads","issues_url":"https://api.github.com/repos/garbear/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/garbear/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/garbear/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/garbear/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garbear/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/garbear/xbmc/releases{/id}","deployments_url":"https://api.github.com/repos/garbear/xbmc/deployments","created_at":"2011-04-09T22:51:29Z","updated_at":"2016-08-25T17:19:46Z","pushed_at":"2016-08-31T19:39:31Z","git_url":"git://github.com/garbear/xbmc.git","ssh_url":"git@github.com:garbear/xbmc.git","clone_url":"https://github.com/garbear/xbmc.git","svn_url":"https://github.com/garbear/xbmc","homepage":"http://xbmc.org","size":585114,"stargazers_count":93,"watchers_count":93,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":8,"forks":46,"open_issues":8,"watchers":93,"default_branch":"retroplayer-17beta2"}},"base":{"label":"xbmc:master","ref":"master","sha":"1f94b1cc656491b675e47997160c90fca277585b","user":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"repo":{"id":1217614,"name":"xbmc","full_name":"xbmc/xbmc","owner":{"login":"xbmc","id":199122,"avatar_url":"https://avatars.githubusercontent.com/u/199122?v=3","gravatar_id":"","url":"https://api.github.com/users/xbmc","html_url":"https://github.com/xbmc","followers_url":"https://api.github.com/users/xbmc/followers","following_url":"https://api.github.com/users/xbmc/following{/other_user}","gists_url":"https://api.github.com/users/xbmc/gists{/gist_id}","starred_url":"https://api.github.com/users/xbmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xbmc/subscriptions","organizations_url":"https://api.github.com/users/xbmc/orgs","repos_url":"https://api.github.com/users/xbmc/repos","events_url":"https://api.github.com/users/xbmc/events{/privacy}","received_events_url":"https://api.github.com/users/xbmc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xbmc/xbmc","description":"Kodi Main Repository - By using this code you agree with our policy and will follow the GPLv2 license as included","fork":false,"url":"https://api.github.com/repos/xbmc/xbmc","forks_url":"https://api.github.com/repos/xbmc/xbmc/forks","keys_url":"https://api.github.com/repos/xbmc/xbmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xbmc/xbmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xbmc/xbmc/teams","hooks_url":"https://api.github.com/repos/xbmc/xbmc/hooks","issue_events_url":"https://api.github.com/repos/xbmc/xbmc/issues/events{/number}","events_url":"https://api.github.com/repos/xbmc/xbmc/events","assignees_url":"https://api.github.com/repos/xbmc/xbmc/assignees{/user}","branches_url":"https://api.github.com/repos/xbmc/xbmc/branches{/branch}","tags_url":"https://api.github.com/repos/xbmc/xbmc/tags","blobs_url":"https://api.github.com/repos/xbmc/xbmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xbmc/xbmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xbmc/xbmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/xbmc/xbmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xbmc/xbmc/statuses/{sha}","languages_url":"https://api.github.com/repos/xbmc/xbmc/languages","stargazers_url":"https://api.github.com/repos/xbmc/xbmc/stargazers","contributors_url":"https://api.github.com/repos/xbmc/xbmc/contributors","subscribers_url":"https://api.github.com/repos/xbmc/xbmc/subscribers","subscription_url":"https://api.github.com/repos/xbmc/xbmc/subscription","commits_url":"https://api.github.com/repos/xbmc/xbmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/xbmc/xbmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/xbmc/xbmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/xbmc/xbmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/xbmc/xbmc/contents/{+path}","compare_url":"https://api.github.com/repos/xbmc/xbmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xbmc/xbmc/merges","archive_url":"https://api.github.com/repos/xbmc/xbmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xbmc/xbmc/downloads","issues_url":"https://api.github.com/repos/xbmc/xbmc/issues{/number}","pulls_url":"https://api.github.com/repos/xbmc/xbmc/pulls{/number}","milestones_url":"https://api.github.com/repos/xbmc/xbmc/milestones{/number}","notifications_url":"https://api.github.com/repos/xbmc/xbmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xbmc/xbmc/labels{/name}","releases_url":"https://api.github.com/repos/xbmc/xbmc/releases{/id}","deployments_url":"https://api.github.com/repos/xbmc/xbmc/deployments","created_at":"2011-01-03T21:18:51Z","updated_at":"2016-09-02T20:27:45Z","pushed_at":"2016-09-04T08:21:50Z","git_url":"git://github.com/xbmc/xbmc.git","ssh_url":"git@github.com:xbmc/xbmc.git","clone_url":"https://github.com/xbmc/xbmc.git","svn_url":"https://github.com/xbmc/xbmc","homepage":"http://kodi.wiki/view/Official:Trademark_Policy","size":1763105,"stargazers_count":5024,"watchers_count":5024,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3656,"mirror_url":null,"open_issues_count":191,"forks":3656,"open_issues":191,"watchers":5024,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/10309"},"html":{"href":"https://github.com/xbmc/xbmc/pull/10309"},"issue":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/10309"},"comments":{"href":"https://api.github.com/repos/xbmc/xbmc/issues/10309/comments"},"review_comments":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/10309/comments"},"review_comment":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xbmc/xbmc/pulls/10309/commits"},"statuses":{"href":"https://api.github.com/repos/xbmc/xbmc/statuses/c4b6eb3ead4417c7f1414171be55822523c81dfd"}}}}
{"actor":{"display_login":"MilhouseVH"}}