{"action":"created","comment":{"url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/comments/238611025","pull_request_review_id":181192214,"id":238611025,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODYxMTAyNQ==","diff_hunk":"@@ -0,0 +1,85 @@\n+## Joystick HID Device\n+\n+The keyboard can be made to be recognized as a joystick HID device by the Operating System. \n+\n+This is enabled by adding the following to `rules.mk`\n+\n+```\n+JOYSTICK_ENABLE = yes\n+```\n+\n+### Configuring the joystick\n+\n+The default joystick has 2 axes and and 8 buttons. This can be changed from the config.h file : \n+\n+```\n+//max 32 for JOYSTICK_BUTTON_COUNT\n+#define JOYSTICK_BUTTON_COUNT 16\n+//max 6 for JOYSTICK_AXES_COUNT\n+#define JOYSTICK_AXES_COUNT 3\n+```\n+\n+When defining axes for your joystick, you have to provide a definition array for it. You can do this from your keymap.c file.\n+A joystick will either be read from an input pin that allows the use of an ADC, or can be virtual, so that its value is provided by your code.\n+You have to define an array of type ''joystick_config_t'' and of proper size, in the following way : \n+\n+```\n+//joystick config\n+joystick_config_t joystick_axes[JOYSTICK_AXES_COUNT] = {\n+  [0] = {D7, 65280, 65472},\n+  [1] = {JS_VIRTUAL_AXIS, 65280, 65472}\n+};\n+```\n+\n+In this example, the first axis will be read from the D7 pin, using an analogRead, whereas the second axis will not be read.\n+In order to give a value to the second axis, you can do so in any custimizable entry point of quantum : as an action, in process_record_user or in matrix_scan_user, or even in joystick_task(void) which is call even when no key has been pressed.\n+You assign a value by writing to joystick_status.axes[axis_index] a signed 8bit value (-127 to 127). Then it is necessary to assign the flag JS_UPDATED to joystick_status.status in order for the change to be taken into account.\n+","path":"docs/feature_joystick.md","position":38,"original_position":37,"commit_id":"0e8c2e4662bbef5bc247d7c9d4ad288e85ba76ec","original_commit_id":"0072ac2e5cc8c50ebd95da179be656e866249b5d","user":{"login":"a-chol","id":8946596,"node_id":"MDQ6VXNlcjg5NDY1OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8946596?v=4","gravatar_id":"","url":"https://api.github.com/users/a-chol","html_url":"https://github.com/a-chol","followers_url":"https://api.github.com/users/a-chol/followers","following_url":"https://api.github.com/users/a-chol/following{/other_user}","gists_url":"https://api.github.com/users/a-chol/gists{/gist_id}","starred_url":"https://api.github.com/users/a-chol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-chol/subscriptions","organizations_url":"https://api.github.com/users/a-chol/orgs","repos_url":"https://api.github.com/users/a-chol/repos","events_url":"https://api.github.com/users/a-chol/events{/privacy}","received_events_url":"https://api.github.com/users/a-chol/received_events","type":"User","site_admin":false},"body":"You're right, that's an oversight on my part, I'll add it. I'll check some more in the evening (CET) to see if I spot any mistake in the Lufa implementation. Do you have a tool that could display the hid report descriptors received for the device?","created_at":"2018-12-04T10:45:36Z","updated_at":"2018-12-04T10:45:36Z","html_url":"https://github.com/qmk/qmk_firmware/pull/4226#discussion_r238611025","pull_request_url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/comments/238611025"},"html":{"href":"https://github.com/qmk/qmk_firmware/pull/4226#discussion_r238611025"},"pull_request":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226"}},"in_reply_to_id":236948395},"pull_request":{"url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226","id":225365923,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MzY1OTIz","html_url":"https://github.com/qmk/qmk_firmware/pull/4226","diff_url":"https://github.com/qmk/qmk_firmware/pull/4226.diff","patch_url":"https://github.com/qmk/qmk_firmware/pull/4226.patch","issue_url":"https://api.github.com/repos/qmk/qmk_firmware/issues/4226","number":4226,"state":"open","locked":false,"title":"Hid joystick interface","user":{"login":"a-chol","id":8946596,"node_id":"MDQ6VXNlcjg5NDY1OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8946596?v=4","gravatar_id":"","url":"https://api.github.com/users/a-chol","html_url":"https://github.com/a-chol","followers_url":"https://api.github.com/users/a-chol/followers","following_url":"https://api.github.com/users/a-chol/following{/other_user}","gists_url":"https://api.github.com/users/a-chol/gists{/gist_id}","starred_url":"https://api.github.com/users/a-chol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-chol/subscriptions","organizations_url":"https://api.github.com/users/a-chol/orgs","repos_url":"https://api.github.com/users/a-chol/repos","events_url":"https://api.github.com/users/a-chol/events{/privacy}","received_events_url":"https://api.github.com/users/a-chol/received_events","type":"User","site_admin":false},"body":"This implements a joystick feature, including a joystick_task function called from tmk, specific keycodes for joystick buttons and a usb hid interface for v-usb and lufa.\r\nI tested the v-usb backend, as I have a compatible board, but only provide a compilable-but-untested implementation for lufa. Runtime tests of this backend is appreciated.\r\nIn order to test, you have to add JOYSTICK_ENABLE = yes to your rules.mk and \r\n```\r\n#define JOYSTICK_BUTTON_COUNT 8\r\n#define JOYSTICK_AXES_COUNT 2\r\n```\r\nin your config.h\r\n\r\nAny feedback is appreciated.","created_at":"2018-10-24T11:30:27Z","updated_at":"2018-12-04T10:45:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23ed7dc7615f16b92cf6c991ace14a07a2b022f1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":155557982,"node_id":"MDU6TGFiZWwxNTU1NTc5ODI=","url":"https://api.github.com/repos/qmk/qmk_firmware/labels/enhancement","name":"enhancement","color":"c5def5","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226/commits","review_comments_url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226/comments","review_comment_url":"https://api.github.com/repos/qmk/qmk_firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qmk/qmk_firmware/issues/4226/comments","statuses_url":"https://api.github.com/repos/qmk/qmk_firmware/statuses/0e8c2e4662bbef5bc247d7c9d4ad288e85ba76ec","head":{"label":"a-chol:hid_joystick","ref":"hid_joystick","sha":"0e8c2e4662bbef5bc247d7c9d4ad288e85ba76ec","user":{"login":"a-chol","id":8946596,"node_id":"MDQ6VXNlcjg5NDY1OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8946596?v=4","gravatar_id":"","url":"https://api.github.com/users/a-chol","html_url":"https://github.com/a-chol","followers_url":"https://api.github.com/users/a-chol/followers","following_url":"https://api.github.com/users/a-chol/following{/other_user}","gists_url":"https://api.github.com/users/a-chol/gists{/gist_id}","starred_url":"https://api.github.com/users/a-chol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-chol/subscriptions","organizations_url":"https://api.github.com/users/a-chol/orgs","repos_url":"https://api.github.com/users/a-chol/repos","events_url":"https://api.github.com/users/a-chol/events{/privacy}","received_events_url":"https://api.github.com/users/a-chol/received_events","type":"User","site_admin":false},"repo":{"id":131216811,"node_id":"MDEwOlJlcG9zaXRvcnkxMzEyMTY4MTE=","name":"qmk_firmware","full_name":"a-chol/qmk_firmware","private":false,"owner":{"login":"a-chol","id":8946596,"node_id":"MDQ6VXNlcjg5NDY1OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/8946596?v=4","gravatar_id":"","url":"https://api.github.com/users/a-chol","html_url":"https://github.com/a-chol","followers_url":"https://api.github.com/users/a-chol/followers","following_url":"https://api.github.com/users/a-chol/following{/other_user}","gists_url":"https://api.github.com/users/a-chol/gists{/gist_id}","starred_url":"https://api.github.com/users/a-chol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-chol/subscriptions","organizations_url":"https://api.github.com/users/a-chol/orgs","repos_url":"https://api.github.com/users/a-chol/repos","events_url":"https://api.github.com/users/a-chol/events{/privacy}","received_events_url":"https://api.github.com/users/a-chol/received_events","type":"User","site_admin":false},"html_url":"https://github.com/a-chol/qmk_firmware","description":"keyboard controller firmware for Atmel AVR and ARM USB families","fork":true,"url":"https://api.github.com/repos/a-chol/qmk_firmware","forks_url":"https://api.github.com/repos/a-chol/qmk_firmware/forks","keys_url":"https://api.github.com/repos/a-chol/qmk_firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/a-chol/qmk_firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/a-chol/qmk_firmware/teams","hooks_url":"https://api.github.com/repos/a-chol/qmk_firmware/hooks","issue_events_url":"https://api.github.com/repos/a-chol/qmk_firmware/issues/events{/number}","events_url":"https://api.github.com/repos/a-chol/qmk_firmware/events","assignees_url":"https://api.github.com/repos/a-chol/qmk_firmware/assignees{/user}","branches_url":"https://api.github.com/repos/a-chol/qmk_firmware/branches{/branch}","tags_url":"https://api.github.com/repos/a-chol/qmk_firmware/tags","blobs_url":"https://api.github.com/repos/a-chol/qmk_firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/a-chol/qmk_firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/a-chol/qmk_firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/a-chol/qmk_firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/a-chol/qmk_firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/a-chol/qmk_firmware/languages","stargazers_url":"https://api.github.com/repos/a-chol/qmk_firmware/stargazers","contributors_url":"https://api.github.com/repos/a-chol/qmk_firmware/contributors","subscribers_url":"https://api.github.com/repos/a-chol/qmk_firmware/subscribers","subscription_url":"https://api.github.com/repos/a-chol/qmk_firmware/subscription","commits_url":"https://api.github.com/repos/a-chol/qmk_firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/a-chol/qmk_firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/a-chol/qmk_firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/a-chol/qmk_firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/a-chol/qmk_firmware/contents/{+path}","compare_url":"https://api.github.com/repos/a-chol/qmk_firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/a-chol/qmk_firmware/merges","archive_url":"https://api.github.com/repos/a-chol/qmk_firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/a-chol/qmk_firmware/downloads","issues_url":"https://api.github.com/repos/a-chol/qmk_firmware/issues{/number}","pulls_url":"https://api.github.com/repos/a-chol/qmk_firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/a-chol/qmk_firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/a-chol/qmk_firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/a-chol/qmk_firmware/labels{/name}","releases_url":"https://api.github.com/repos/a-chol/qmk_firmware/releases{/id}","deployments_url":"https://api.github.com/repos/a-chol/qmk_firmware/deployments","created_at":"2018-04-26T22:24:24Z","updated_at":"2018-10-19T08:39:30Z","pushed_at":"2018-11-30T23:24:32Z","git_url":"git://github.com/a-chol/qmk_firmware.git","ssh_url":"git@github.com:a-chol/qmk_firmware.git","clone_url":"https://github.com/a-chol/qmk_firmware.git","svn_url":"https://github.com/a-chol/qmk_firmware","homepage":"http://qmk.fm","size":105374,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qmk:master","ref":"master","sha":"81ce35c10a89214a586773e013e647eeb701fee5","user":{"login":"qmk","id":25358678,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzU4Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/25358678?v=4","gravatar_id":"","url":"https://api.github.com/users/qmk","html_url":"https://github.com/qmk","followers_url":"https://api.github.com/users/qmk/followers","following_url":"https://api.github.com/users/qmk/following{/other_user}","gists_url":"https://api.github.com/users/qmk/gists{/gist_id}","starred_url":"https://api.github.com/users/qmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qmk/subscriptions","organizations_url":"https://api.github.com/users/qmk/orgs","repos_url":"https://api.github.com/users/qmk/repos","events_url":"https://api.github.com/users/qmk/events{/privacy}","received_events_url":"https://api.github.com/users/qmk/received_events","type":"Organization","site_admin":false},"repo":{"id":27737393,"node_id":"MDEwOlJlcG9zaXRvcnkyNzczNzM5Mw==","name":"qmk_firmware","full_name":"qmk/qmk_firmware","private":false,"owner":{"login":"qmk","id":25358678,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzU4Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/25358678?v=4","gravatar_id":"","url":"https://api.github.com/users/qmk","html_url":"https://github.com/qmk","followers_url":"https://api.github.com/users/qmk/followers","following_url":"https://api.github.com/users/qmk/following{/other_user}","gists_url":"https://api.github.com/users/qmk/gists{/gist_id}","starred_url":"https://api.github.com/users/qmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qmk/subscriptions","organizations_url":"https://api.github.com/users/qmk/orgs","repos_url":"https://api.github.com/users/qmk/repos","events_url":"https://api.github.com/users/qmk/events{/privacy}","received_events_url":"https://api.github.com/users/qmk/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/qmk/qmk_firmware","description":"keyboard controller firmware for Atmel AVR and ARM USB families","fork":false,"url":"https://api.github.com/repos/qmk/qmk_firmware","forks_url":"https://api.github.com/repos/qmk/qmk_firmware/forks","keys_url":"https://api.github.com/repos/qmk/qmk_firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qmk/qmk_firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qmk/qmk_firmware/teams","hooks_url":"https://api.github.com/repos/qmk/qmk_firmware/hooks","issue_events_url":"https://api.github.com/repos/qmk/qmk_firmware/issues/events{/number}","events_url":"https://api.github.com/repos/qmk/qmk_firmware/events","assignees_url":"https://api.github.com/repos/qmk/qmk_firmware/assignees{/user}","branches_url":"https://api.github.com/repos/qmk/qmk_firmware/branches{/branch}","tags_url":"https://api.github.com/repos/qmk/qmk_firmware/tags","blobs_url":"https://api.github.com/repos/qmk/qmk_firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qmk/qmk_firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qmk/qmk_firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/qmk/qmk_firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qmk/qmk_firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/qmk/qmk_firmware/languages","stargazers_url":"https://api.github.com/repos/qmk/qmk_firmware/stargazers","contributors_url":"https://api.github.com/repos/qmk/qmk_firmware/contributors","subscribers_url":"https://api.github.com/repos/qmk/qmk_firmware/subscribers","subscription_url":"https://api.github.com/repos/qmk/qmk_firmware/subscription","commits_url":"https://api.github.com/repos/qmk/qmk_firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/qmk/qmk_firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/qmk/qmk_firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/qmk/qmk_firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/qmk/qmk_firmware/contents/{+path}","compare_url":"https://api.github.com/repos/qmk/qmk_firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qmk/qmk_firmware/merges","archive_url":"https://api.github.com/repos/qmk/qmk_firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qmk/qmk_firmware/downloads","issues_url":"https://api.github.com/repos/qmk/qmk_firmware/issues{/number}","pulls_url":"https://api.github.com/repos/qmk/qmk_firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/qmk/qmk_firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/qmk/qmk_firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qmk/qmk_firmware/labels{/name}","releases_url":"https://api.github.com/repos/qmk/qmk_firmware/releases{/id}","deployments_url":"https://api.github.com/repos/qmk/qmk_firmware/deployments","created_at":"2014-12-08T22:02:05Z","updated_at":"2018-12-04T09:37:45Z","pushed_at":"2018-12-04T05:43:29Z","git_url":"git://github.com/qmk/qmk_firmware.git","ssh_url":"git@github.com:qmk/qmk_firmware.git","clone_url":"https://github.com/qmk/qmk_firmware.git","svn_url":"https://github.com/qmk/qmk_firmware","homepage":"http://qmk.fm","size":120787,"stargazers_count":3317,"watchers_count":3317,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":6272,"mirror_url":null,"archived":false,"open_issues_count":320,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":6272,"open_issues":320,"watchers":3317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226"},"html":{"href":"https://github.com/qmk/qmk_firmware/pull/4226"},"issue":{"href":"https://api.github.com/repos/qmk/qmk_firmware/issues/4226"},"comments":{"href":"https://api.github.com/repos/qmk/qmk_firmware/issues/4226/comments"},"review_comments":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226/comments"},"review_comment":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qmk/qmk_firmware/pulls/4226/commits"},"statuses":{"href":"https://api.github.com/repos/qmk/qmk_firmware/statuses/0e8c2e4662bbef5bc247d7c9d4ad288e85ba76ec"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"a-chol"}}