{"action":"created","issue":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/3204","labels_url":"https://api.github.com/repos/nwjs/nw.js/issues/3204/labels{/name}","comments_url":"https://api.github.com/repos/nwjs/nw.js/issues/3204/comments","events_url":"https://api.github.com/repos/nwjs/nw.js/issues/3204/events","html_url":"https://github.com/nwjs/nw.js/issues/3204","id":60306355,"number":3204,"title":"how to register a shortcut only for the application?","user":{"login":"PierBover","id":226483,"avatar_url":"https://avatars.githubusercontent.com/u/226483?v=3","gravatar_id":"","url":"https://api.github.com/users/PierBover","html_url":"https://github.com/PierBover","followers_url":"https://api.github.com/users/PierBover/followers","following_url":"https://api.github.com/users/PierBover/following{/other_user}","gists_url":"https://api.github.com/users/PierBover/gists{/gist_id}","starred_url":"https://api.github.com/users/PierBover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierBover/subscriptions","organizations_url":"https://api.github.com/users/PierBover/orgs","repos_url":"https://api.github.com/users/PierBover/repos","events_url":"https://api.github.com/users/PierBover/events{/privacy}","received_events_url":"https://api.github.com/users/PierBover/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-09T07:08:20Z","updated_at":"2015-04-17T15:29:29Z","closed_at":null,"body":"I'm using `registerGlobalHotKey` but they get triggered even outside the application.\r\n\r\nIs there a way of creating application shortcuts via some NWJS object?\r\n\r\nYes, I can use JS to make my own, but they require the window to be in focus to receive keyboard events. In OSX an application can have many windows and none of those windows be in focus, while the application is indeed in focus. I was wondering if there was something already done in NWJS in this front.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9345309-how-to-register-a-shortcut-only-for-the-application?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/comments/94009449","html_url":"https://github.com/nwjs/nw.js/issues/3204#issuecomment-94009449","issue_url":"https://api.github.com/repos/nwjs/nw.js/issues/3204","id":94009449,"user":{"login":"broderix","id":95613,"avatar_url":"https://avatars.githubusercontent.com/u/95613?v=3","gravatar_id":"","url":"https://api.github.com/users/broderix","html_url":"https://github.com/broderix","followers_url":"https://api.github.com/users/broderix/followers","following_url":"https://api.github.com/users/broderix/following{/other_user}","gists_url":"https://api.github.com/users/broderix/gists{/gist_id}","starred_url":"https://api.github.com/users/broderix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broderix/subscriptions","organizations_url":"https://api.github.com/users/broderix/orgs","repos_url":"https://api.github.com/users/broderix/repos","events_url":"https://api.github.com/users/broderix/events{/privacy}","received_events_url":"https://api.github.com/users/broderix/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T15:29:29Z","updated_at":"2015-04-17T15:29:29Z","body":"See https://github.com/nwjs/nw.js/wiki/Shortcut\r\nYou can try something like this to get focus:\r\npackage.json:\r\n`\r\n\"window\": {\r\n    \"show\": false,\r\n...\r\n}\r\n`\r\n\r\n```javascript\r\nvar window = gui.Window.get();\r\nwindow.focus();\r\nvar shortcut = new gui.Shortcut(option);\r\n...\r\n```"}}