{"action":"closed","issue":{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1428","labels_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1428/labels{/name}","comments_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1428/comments","events_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1428/events","html_url":"https://github.com/BladeRunnerJS/brjs/issues/1428","id":88741309,"number":1428,"title":"Create a Keybinding service","user":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/labels/4%20-%20ReadyForTest","name":"4 - ReadyForTest","color":"CCCCCC"},{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/labels/feature","name":"feature","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/milestones/40","html_url":"https://github.com/BladeRunnerJS/brjs/milestones/Current%20Focus","labels_url":"https://api.github.com/repos/BladeRunnerJS/brjs/milestones/40/labels","id":1305862,"number":40,"title":"Current Focus","description":"","creator":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":22,"state":"open","created_at":"2015-09-15T07:41:01Z","updated_at":"2015-10-23T08:33:39Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-06-16T14:18:57Z","updated_at":"2015-10-23T08:33:39Z","closed_at":"2015-10-23T08:33:39Z","body":"@janhancic has identified the need for a service that allows blades to register actions that users might want to run using a key-combination. For example:\r\n\r\n```js\r\nvar keybindingService = require('service!br.keybinding-service');\r\nkeybindingService.registerAction('acme.explode-tnt', \"Causes all TNT to be exploded.\",\r\n    tnt.explode.bind(tnt)).withDefaultBinding('Ctrl-Shift-E');\r\n```\r\n\r\nApps are free to override the default key-binding suggested by a blade (assuming a default has been provided), like so:\r\n\r\n```js\r\nkeybindingService.rebindAction('acme.explode-tnt', 'Ctrl-E');\r\n```\r\n\r\nBlades can ensure that their actions have unique identifiers by prefixing any action ids with the blade's namespace. If multiple blades attempt to set the same default key-binding then none of the actions inherit the default, and the app is required to explicitly bind these actions.\r\n\r\n\r\n<!---\r\n@huboard:{\"order\":776.5,\"milestone_order\":1428,\"custom_state\":\"\"}\n-->\r\n"}}