{"action":"created","issue":{"url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/16","repository_url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary","labels_url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/16/comments","events_url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/16/events","html_url":"https://github.com/MHeironimus/ArduinoJoystickLibrary/issues/16","id":175124954,"number":16,"title":"Android A/B/X/Y button mappings","user":{"login":"marekhalmo","id":6008696,"avatar_url":"https://avatars.githubusercontent.com/u/6008696?v=3","gravatar_id":"","url":"https://api.github.com/users/marekhalmo","html_url":"https://github.com/marekhalmo","followers_url":"https://api.github.com/users/marekhalmo/followers","following_url":"https://api.github.com/users/marekhalmo/following{/other_user}","gists_url":"https://api.github.com/users/marekhalmo/gists{/gist_id}","starred_url":"https://api.github.com/users/marekhalmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekhalmo/subscriptions","organizations_url":"https://api.github.com/users/marekhalmo/orgs","repos_url":"https://api.github.com/users/marekhalmo/repos","events_url":"https://api.github.com/users/marekhalmo/events{/privacy}","received_events_url":"https://api.github.com/users/marekhalmo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-05T20:35:06Z","updated_at":"2016-09-06T11:33:57Z","closed_at":null,"body":"Could you add the possibility to press button A/B/X/Y on android gamepad?\r\n\r\nThe mappings of this joystick are arround 188 (index 0) and higher.. the button mappings for standard android buttons are;\r\nA: 96\r\nB: 97\r\nX: 99\r\ny: 100\r\nRT: 103\r\nLT: 102\r\nTR: 107\r\nTL: 106\r\nStart: 108\r\nVolume: 183\r\nBack: 4\r\n\r\nThis button mappings are taken from NVIDIA Shield Portable and should be working for most of the Android Gamepads"},"comment":{"url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/comments/244923886","html_url":"https://github.com/MHeironimus/ArduinoJoystickLibrary/issues/16#issuecomment-244923886","issue_url":"https://api.github.com/repos/MHeironimus/ArduinoJoystickLibrary/issues/16","id":244923886,"user":{"login":"marekhalmo","id":6008696,"avatar_url":"https://avatars.githubusercontent.com/u/6008696?v=3","gravatar_id":"","url":"https://api.github.com/users/marekhalmo","html_url":"https://github.com/marekhalmo","followers_url":"https://api.github.com/users/marekhalmo/followers","following_url":"https://api.github.com/users/marekhalmo/following{/other_user}","gists_url":"https://api.github.com/users/marekhalmo/gists{/gist_id}","starred_url":"https://api.github.com/users/marekhalmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marekhalmo/subscriptions","organizations_url":"https://api.github.com/users/marekhalmo/orgs","repos_url":"https://api.github.com/users/marekhalmo/repos","events_url":"https://api.github.com/users/marekhalmo/events{/privacy}","received_events_url":"https://api.github.com/users/marekhalmo/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T11:33:57Z","updated_at":"2016-09-06T11:33:57Z","body":"It is not a multi button command.. value 188 is generated if i send button 0 command only.\r\n\r\nSorry for my long reply but this is my current state of research:\r\nI have been searching for Android HID Descriptors and can't really find any.. the closest thing that i found is for OUYA gamepad (Ouya runs modified Android - Post here: http://forum.xda-developers.com/showthread.php?t=2351437)\r\n\r\nThe gamepad buttons A/B/X/Y are bound using following entry in the HID Descriptor lines:\r\n Usage(16)\r\n        Button.0001\r\n        .\r\n        .\r\n        .\r\n        Button.0010\r\n      Logical Minimum(0)\r\n      Logical Maximum(65535)\r\n      Physical Minimum(0)\r\n      Physical Maximum(65535)\r\n      Report Size(1)\r\n      Report Count(16)\r\n      Report Offset(96)\r\n      Flags( Variable Absolute )\r\n\r\nWhich translates to:\r\nButton.0001 ---> Key.BtnA\r\nButton.0002 ---> Key.BtnB\r\nButton.0003 ---> Key.BtnC\r\nButton.0004 ---> Key.BtnX\r\nButton.0005 ---> Key.BtnY\r\nButton.0006 ---> Key.BtnZ\r\n... e.t.c.\r\n\r\nThe important part is \r\nReport Offset(96) which shifts the button reported to the proper region (e.g. Button 0 is reported as 96)\r\n\r\nSo the solution is to add Report Offset entry to the HID descriptior in your code.. but i can't find the way to do this using HID Descriptor Tool (there is no such entry possible).\r\n\r\nI was trying to manually decrypt the OUYA hid descriptor (numbers at the start of the descriptior text in the linked pag).. but so far i had no luck identifying the proper key/value pair in HEX\r\n\r\nI'm also reading the USB specs but no luck finding any info there :)\r\n\r\nAny ideas how to get the codes for Report Offset(96)?"}}
{"actor":{"display_login":"marekhalmo"}}