{"action":"opened","issue":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/724","labels_url":"https://api.github.com/repos/melonjs/melonJS/issues/724/labels{/name}","comments_url":"https://api.github.com/repos/melonjs/melonJS/issues/724/comments","events_url":"https://api.github.com/repos/melonjs/melonJS/issues/724/events","html_url":"https://github.com/melonjs/melonJS/issues/724","id":101504981,"number":724,"title":"Followup: TODO for gamepad support","user":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/melonjs/melonJS/milestones/22","html_url":"https://github.com/melonjs/melonJS/milestones/3.0.0","labels_url":"https://api.github.com/repos/melonjs/melonJS/milestones/22/labels","id":1148460,"number":22,"title":"3.0.0","description":"Major release","creator":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":33,"state":"open","created_at":"2015-06-03T23:47:17Z","updated_at":"2015-08-17T20:35:57Z","due_on":"2015-08-16T16:00:00Z","closed_at":null},"comments":0,"created_at":"2015-08-17T20:35:57Z","updated_at":"2015-08-17T20:35:57Z","closed_at":null,"body":"Follows #34 \r\n\r\n* [ ] Add a gamepad tester to `examples`; for validating mappings\r\n* [ ] Add a new API for reading and writing action states\r\n  * [ ] `me.input.getActionEdge(action)` (was `me.input.isKeyPressed`)\r\n  * [ ] `me.input.getActionState(action)` (was `me.input.keyState`)\r\n  * [ ] `me.input.getActionValue(action)` (NEW; returns action analog value)\r\n  * [ ] `me.input.getAction(action)` (NEW; returns action analog value, digital state, and digital edge)\r\n  * [ ] `me.input.setAction(action, state, value)` (NEW; sets action analog value and digital state)\r\n* [ ] Add a new method for custom gamepad mapping, with a normalization function\r\n  * `me.input.setGamepadMapping(id, axes, buttons, normalize_fn)`\r\n  * `axes` and `buttons` are each an array of mappings. See https://github.com/melonjs/melonJS/blob/096c14960a0a7978ed3fcce930529a0dec74e0af/src/input/gamepad.js#L22-L23\r\n  * `normalize_fn` will be called on an *unmapped* axis or button with the following parameters:\r\n    * {String} `type` \"axes\" or \"buttons\"\r\n    * {Number} `index` axis or button index (this is the raw index from the gamepad driver, *not* the standard gamepad mapping)\r\n    * {Number} `value` the value read from `navigator.getGamepads()[...][type][index].value`\r\n  * `normalize_fn` must return a normalized value in range `[-1.0..1.0]`, or `0.0` if the button or axis is unknown."}}