{"action":"created","issue":{"url":"https://api.github.com/repos/boppreh/keyboard/issues/152","repository_url":"https://api.github.com/repos/boppreh/keyboard","labels_url":"https://api.github.com/repos/boppreh/keyboard/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/boppreh/keyboard/issues/152/comments","events_url":"https://api.github.com/repos/boppreh/keyboard/issues/152/events","html_url":"https://github.com/boppreh/keyboard/issues/152","id":310625909,"number":152,"title":"on_press and on_release not executing if one is placed after another","user":{"login":"pshe94","id":34661843,"avatar_url":"https://avatars0.githubusercontent.com/u/34661843?v=4","gravatar_id":"","url":"https://api.github.com/users/pshe94","html_url":"https://github.com/pshe94","followers_url":"https://api.github.com/users/pshe94/followers","following_url":"https://api.github.com/users/pshe94/following{/other_user}","gists_url":"https://api.github.com/users/pshe94/gists{/gist_id}","starred_url":"https://api.github.com/users/pshe94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshe94/subscriptions","organizations_url":"https://api.github.com/users/pshe94/orgs","repos_url":"https://api.github.com/users/pshe94/repos","events_url":"https://api.github.com/users/pshe94/events{/privacy}","received_events_url":"https://api.github.com/users/pshe94/received_events","type":"User","site_admin":false},"labels":[{"id":38835501,"url":"https://api.github.com/repos/boppreh/keyboard/labels/bug","name":"bug","color":"fc2929","default":true},{"id":677730290,"url":"https://api.github.com/repos/boppreh/keyboard/labels/high-level","name":"high-level","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-02T22:00:17Z","updated_at":"2018-04-05T22:14:55Z","closed_at":"2018-04-05T22:14:55Z","author_association":"NONE","body":"Hi, I'm using `on_press `and `on_release` to store any currently pressed keys. Unfortunately, if `on_press` is placed before `on_release`, `on_release` is not being executed. If I switch places of `on_press` with `on_release`, then `on_press` is not being executed.\r\nBecause of it, I'm using `hook` as a workaround, in which I'm checking `event_type` and calling proper function.\r\n\r\n```\r\npressed_keys = []\r\n\r\ndef add_key(key):\r\n    pressed_keys.append(key)\r\n    return\r\n\r\ndef remove_key(key):\r\n    pressed_keys.remove(key)\r\n    return\r\n\r\nkeyboard.on_press(add_key)\r\nkeyboard.on_release(remove_key)    #This is not being executed\r\n```\r\n\r\nAlso I have one question: Is there a simpler way of checking in `on_press_key` if other keys are also currently pressed? `modifiers` is always empty."},"comment":{"url":"https://api.github.com/repos/boppreh/keyboard/issues/comments/379093052","html_url":"https://github.com/boppreh/keyboard/issues/152#issuecomment-379093052","issue_url":"https://api.github.com/repos/boppreh/keyboard/issues/152","id":379093052,"user":{"login":"pshe94","id":34661843,"avatar_url":"https://avatars0.githubusercontent.com/u/34661843?v=4","gravatar_id":"","url":"https://api.github.com/users/pshe94","html_url":"https://github.com/pshe94","followers_url":"https://api.github.com/users/pshe94/followers","following_url":"https://api.github.com/users/pshe94/following{/other_user}","gists_url":"https://api.github.com/users/pshe94/gists{/gist_id}","starred_url":"https://api.github.com/users/pshe94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pshe94/subscriptions","organizations_url":"https://api.github.com/users/pshe94/orgs","repos_url":"https://api.github.com/users/pshe94/repos","events_url":"https://api.github.com/users/pshe94/events{/privacy}","received_events_url":"https://api.github.com/users/pshe94/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T22:14:55Z","updated_at":"2018-04-05T22:14:55Z","author_association":"NONE","body":"@boppreh You just made my code a little bit less complicated. Exposing all pressed key is a great idea. Thank you! 👍\r\nAlso I have one off-topic question, if you don't mind me asking here. There is no way of combining mouse button presses with keyboard keys? For example hotkey `Ctrl+mouse X2`? I can see that handling mouse is in a separate library, but then I would have to write some kind of wrapper for both of them"}}
{"actor":{"display_login":"pshe94"}}