{"action":"created","issue":{"url":"https://api.github.com/repos/supercollider/hidapi/issues/1","repository_url":"https://api.github.com/repos/supercollider/hidapi","labels_url":"https://api.github.com/repos/supercollider/hidapi/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/supercollider/hidapi/issues/1/comments","events_url":"https://api.github.com/repos/supercollider/hidapi/issues/1/events","html_url":"https://github.com/supercollider/hidapi/pull/1","id":156175924,"number":1,"title":"HID support for Windows and various additions towards HID in 3.8","user":{"login":"llloret","id":1238515,"avatar_url":"https://avatars.githubusercontent.com/u/1238515?v=3","gravatar_id":"","url":"https://api.github.com/users/llloret","html_url":"https://github.com/llloret","followers_url":"https://api.github.com/users/llloret/followers","following_url":"https://api.github.com/users/llloret/following{/other_user}","gists_url":"https://api.github.com/users/llloret/gists{/gist_id}","starred_url":"https://api.github.com/users/llloret/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llloret/subscriptions","organizations_url":"https://api.github.com/users/llloret/orgs","repos_url":"https://api.github.com/users/llloret/repos","events_url":"https://api.github.com/users/llloret/events{/privacy}","received_events_url":"https://api.github.com/users/llloret/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-05-22T22:03:51Z","updated_at":"2016-09-07T08:15:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/supercollider/hidapi/pulls/1","html_url":"https://github.com/supercollider/hidapi/pull/1","diff_url":"https://github.com/supercollider/hidapi/pull/1.diff","patch_url":"https://github.com/supercollider/hidapi/pull/1.patch"},"body":"This PR brings initial HID support for Windows. At the moment it is only HID input, and the plan is to add output, and feature in the near future.\r\n\r\nThe idea of this first PR is to serve as a base for initial discussion to see what’s the best way to have Windows support on SC again. Disclaimer: before this effort, I had no idea of HID, so there might be things that are way off. Please be patient with me ;). The commits in the PR follow the development history, they are not completely organised by feature, but almost.\r\n\r\nSome important points:\r\n- The Windows API for HID report descriptor parsing is different to the Mac, and Linux one. We cannot access the raw descriptor and in Linux, so I use a similar approach as the Mac one. This is done in the hid_parse_element_info function. The interesting functions from the Windows API here are:\r\n  - HidP_GetCaps, to get info about collections, and how many input, output and feature button and value controls we have\r\n  - HidP_GetLinkCollectionNodes, to get info about the collections\r\n  - HidP_GetButtonCaps, to get info about the button capabilities, usages, etc\r\n  - HidP_GetValueCaps, to get info about the other controls, usages, etc\r\n- Then, to parse the reports themselves, this is done on hid_parse_input_elements_values\r\n  - This function gets the size of the report in the size argument (note this is added in the Windows version, in other platforms, the size argument is not passed). This data is available at the point of call in SC_HID_api, and is passed to the caller of hid_parse_input_element_values, so I just extended the call to pass it along.\r\n  - The parsing of the input report is very different and it uses a different mechanism for buttons and other elements:\r\n    - HidP_MaxUsageListLength and HidP_GetButtonsEx, to get a list of the usages of buttons that are set to ON on the report. Others are implicitly set to 0.\r\n    - HidP_GetUsageValue, to get the value of a given usage\r\n- I have tried to keep the elements (hid_device_element) compatible with how they were used in the previous platforms, and it looks good on my testing. There are some things like report sizes and indexes that are not used in Windows and may differ. Not sure how important that is, but it may be something worth having  a look.\r\n- Using the HIDFunc class to register actions should be tha same on all platforms if using the usage, device, usageID, … functions. As noted on the elements function help, the element IDs will be different than in other platforms since the parsing is completely different.\r\n- I have removed the DDK stuff, since now it is quite straightforward to compile with the normal Windows SDK that comes with VS. Perhaps someone would prefer to have that.\r\n- At this point I am not too sure about how to handle reports with array elements. I (or @bagong) do not have access to any device that reports an array. @bagong and I are putting together a Wiki in the HID github repository, to gather data about HID devices, that may help in future development. \r\n"},"comment":{"url":"https://api.github.com/repos/supercollider/hidapi/issues/comments/245208330","html_url":"https://github.com/supercollider/hidapi/pull/1#issuecomment-245208330","issue_url":"https://api.github.com/repos/supercollider/hidapi/issues/1","id":245208330,"user":{"login":"adcxyz","id":3518579,"avatar_url":"https://avatars.githubusercontent.com/u/3518579?v=3","gravatar_id":"","url":"https://api.github.com/users/adcxyz","html_url":"https://github.com/adcxyz","followers_url":"https://api.github.com/users/adcxyz/followers","following_url":"https://api.github.com/users/adcxyz/following{/other_user}","gists_url":"https://api.github.com/users/adcxyz/gists{/gist_id}","starred_url":"https://api.github.com/users/adcxyz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adcxyz/subscriptions","organizations_url":"https://api.github.com/users/adcxyz/orgs","repos_url":"https://api.github.com/users/adcxyz/repos","events_url":"https://api.github.com/users/adcxyz/events{/privacy}","received_events_url":"https://api.github.com/users/adcxyz/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T08:15:19Z","updated_at":"2016-09-07T08:15:19Z","body":"just got back from 2 weeks of holidays, sorry \nI dont get this to compile on my machine, \nis there a travis build with it that I can download and try? \n\nbest adc\n\n> On 07/09/2016, at 09:58 , Chris Sattinger <notifications@github.com> wrote:\n> \n> This is a blocker for 3.8\n> \n> @adcxyz can you quit your day job and devote yourself 110% to supercollider ? thankx !\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n\n"}}
{"actor":{"display_login":"adcxyz"}}