{"action":"created","issue":{"url":"https://api.github.com/repos/abo-abo/hydra/issues/55","labels_url":"https://api.github.com/repos/abo-abo/hydra/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/abo-abo/hydra/issues/55/comments","events_url":"https://api.github.com/repos/abo-abo/hydra/issues/55/events","html_url":"https://github.com/abo-abo/hydra/issues/55","id":59011287,"number":55,"title":"Enable to define key-chord when hydra on","user":{"login":"deftsp","id":19593,"avatar_url":"https://avatars.githubusercontent.com/u/19593?v=3","gravatar_id":"","url":"https://api.github.com/users/deftsp","html_url":"https://github.com/deftsp","followers_url":"https://api.github.com/users/deftsp/followers","following_url":"https://api.github.com/users/deftsp/following{/other_user}","gists_url":"https://api.github.com/users/deftsp/gists{/gist_id}","starred_url":"https://api.github.com/users/deftsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deftsp/subscriptions","organizations_url":"https://api.github.com/users/deftsp/orgs","repos_url":"https://api.github.com/users/deftsp/repos","events_url":"https://api.github.com/users/deftsp/events{/privacy}","received_events_url":"https://api.github.com/users/deftsp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-26T03:11:13Z","updated_at":"2015-02-26T09:56:27Z","closed_at":null,"body":"As a evil user, I bind  key-chord \"fd\" to a function, which enable me  to escape from insert state and everything else.  So, How can I do that when hydra is active?\r\n\r\nI have tryed `(key-chord-define hydra-base-map \"df\" 'pl/escape-dwim)`  but it not work."},"comment":{"url":"https://api.github.com/repos/abo-abo/hydra/issues/comments/76150667","html_url":"https://github.com/abo-abo/hydra/issues/55#issuecomment-76150667","issue_url":"https://api.github.com/repos/abo-abo/hydra/issues/55","id":76150667,"user":{"login":"abo-abo","id":2937359,"avatar_url":"https://avatars.githubusercontent.com/u/2937359?v=3","gravatar_id":"","url":"https://api.github.com/users/abo-abo","html_url":"https://github.com/abo-abo","followers_url":"https://api.github.com/users/abo-abo/followers","following_url":"https://api.github.com/users/abo-abo/following{/other_user}","gists_url":"https://api.github.com/users/abo-abo/gists{/gist_id}","starred_url":"https://api.github.com/users/abo-abo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abo-abo/subscriptions","organizations_url":"https://api.github.com/users/abo-abo/orgs","repos_url":"https://api.github.com/users/abo-abo/repos","events_url":"https://api.github.com/users/abo-abo/events{/privacy}","received_events_url":"https://api.github.com/users/abo-abo/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T09:56:27Z","updated_at":"2015-02-26T09:56:27Z","body":"This can't be done easily.\r\nWhen the hydra is active, it intercepts all keyboard input.\r\nAnd `key-chord-define` doesn't treat the keymap in a standard way, so the hydra exits\r\nwhen <kbd>d</kbd> is pressed, since it's not recognized that it belongs to the hydra.\r\n\r\nTry the much easier solution:\r\n\r\n```cl\r\n(defun my-escape ()\r\n  (interactive)\r\n  (hydra-keyboard-quit)\r\n  (message \"hydra exit\"))\r\n\r\n(define-key hydra-base-map \"q\" 'my-escape)\r\n```\r\n\r\nRemember that the above has to be done after `(require 'hydra)`, but\r\nbefore any calls to `defhydra`.\r\n\r\nYou can even have your longer binding, if you want:\r\n\r\n```cl\r\n(define-key hydra-base-map \"df\" 'my-escape)\r\n```\r\n"}}