{"action":"created","issue":{"url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/136","labels_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/136/comments","events_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/136/events","html_url":"https://github.com/chieffancypants/angular-hotkeys/issues/136","id":63300768,"number":136,"title":"Recommended approach to capture when 'esc' is pressed when an input has focus","user":{"login":"sstorie","id":3630784,"avatar_url":"https://avatars.githubusercontent.com/u/3630784?v=3","gravatar_id":"","url":"https://api.github.com/users/sstorie","html_url":"https://github.com/sstorie","followers_url":"https://api.github.com/users/sstorie/followers","following_url":"https://api.github.com/users/sstorie/following{/other_user}","gists_url":"https://api.github.com/users/sstorie/gists{/gist_id}","starred_url":"https://api.github.com/users/sstorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstorie/subscriptions","organizations_url":"https://api.github.com/users/sstorie/orgs","repos_url":"https://api.github.com/users/sstorie/repos","events_url":"https://api.github.com/users/sstorie/events{/privacy}","received_events_url":"https://api.github.com/users/sstorie/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-20T20:24:23Z","updated_at":"2015-03-23T16:19:12Z","closed_at":"2015-03-23T16:19:12Z","body":"I am trying to add a hotkey within a directive for when a user presses escape while an input field has focus. When the input field has focus the 'esc' press never triggers my hotkey callback, but if I click outside of the input (so it no longer has focus), then my callback is called. Is there a recommended approach for this?\r\n\r\nMy use case is I'm using '/' to set focus on a global search input, and want to bind 'esc' to blur the field if the user decides they don't want to search any longer. I also have some visual changes that happen in this transition."},"comment":{"url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/comments/85073012","html_url":"https://github.com/chieffancypants/angular-hotkeys/issues/136#issuecomment-85073012","issue_url":"https://api.github.com/repos/chieffancypants/angular-hotkeys/issues/136","id":85073012,"user":{"login":"sstorie","id":3630784,"avatar_url":"https://avatars.githubusercontent.com/u/3630784?v=3","gravatar_id":"","url":"https://api.github.com/users/sstorie","html_url":"https://github.com/sstorie","followers_url":"https://api.github.com/users/sstorie/followers","following_url":"https://api.github.com/users/sstorie/following{/other_user}","gists_url":"https://api.github.com/users/sstorie/gists{/gist_id}","starred_url":"https://api.github.com/users/sstorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstorie/subscriptions","organizations_url":"https://api.github.com/users/sstorie/orgs","repos_url":"https://api.github.com/users/sstorie/repos","events_url":"https://api.github.com/users/sstorie/events{/privacy}","received_events_url":"https://api.github.com/users/sstorie/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T16:19:12Z","updated_at":"2015-03-23T16:19:12Z","body":"This is exactly what I was looking for, and of course it's clearly in the docs now that I know what to look for. Thanks for replying!"}}