{"action":"created","issue":{"url":"https://api.github.com/repos/boppreh/keyboard/issues/34","repository_url":"https://api.github.com/repos/boppreh/keyboard","labels_url":"https://api.github.com/repos/boppreh/keyboard/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/boppreh/keyboard/issues/34/comments","events_url":"https://api.github.com/repos/boppreh/keyboard/issues/34/events","html_url":"https://github.com/boppreh/keyboard/issues/34","id":194596729,"number":34,"title":"Linux problems on basic example","user":{"login":"fpp-gh","id":4593667,"avatar_url":"https://avatars.githubusercontent.com/u/4593667?v=3","gravatar_id":"","url":"https://api.github.com/users/fpp-gh","html_url":"https://github.com/fpp-gh","followers_url":"https://api.github.com/users/fpp-gh/followers","following_url":"https://api.github.com/users/fpp-gh/following{/other_user}","gists_url":"https://api.github.com/users/fpp-gh/gists{/gist_id}","starred_url":"https://api.github.com/users/fpp-gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpp-gh/subscriptions","organizations_url":"https://api.github.com/users/fpp-gh/orgs","repos_url":"https://api.github.com/users/fpp-gh/repos","events_url":"https://api.github.com/users/fpp-gh/events{/privacy}","received_events_url":"https://api.github.com/users/fpp-gh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-09T13:28:22Z","updated_at":"2016-12-10T22:27:32Z","closed_at":null,"body":"Hi, me again :-)\r\nGot me a Linux laptop and trying to really use the lib on it, because of course, no AutoHotKey...\r\nUnfortunately I can't get it to run a two-line test example (import keyboard, define one abbreviation).\r\nWith Python 2.7 it bombs:\r\n```python\r\nException in thread Thread-1:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/threading.py\", line 801, in __bootstrap_inner\r\n    self.run()\r\n  File \"/usr/lib/python2.7/threading.py\", line 754, in run\r\n    self.__target(*self.__args, **self.__kwargs)\r\n  File \"/home/fpp/python/PyHotKey/keyboard/__init__.py\", line 114, in listen\r\n    _os_keyboard.listen(self.queue)\r\n  File \"/home/fpp/python/PyHotKey/keyboard/_nixkeyboard.py\", line 111, in listen\r\n    build_device()\r\n  File \"/home/fpp/python/PyHotKey/keyboard/_nixkeyboard.py\", line 106, in build_device\r\n    device = aggregate_devices('kbd')\r\n  File \"/home/fpp/python/PyHotKey/keyboard/_nixcommon.py\", line 145, in aggregate_devices\r\n    uinput = make_uinput()\r\n  File \"/home/fpp/python/PyHotKey/keyboard/_nixcommon.py\", line 48, in make_uinput\r\n    uinput.read = lambda n: Queue().get()\r\nAttributeError: 'file' object attribute 'read' is read-only\r\n```\r\nWith Python3.5 there is no exception but no abbreviation expanding either...\r\n\r\nThis is on XUbuntu 16.04, running the script as root in xterm and testing in Mousepad.\r\nAnything I'm doing wrong ?...\r\n"},"comment":{"url":"https://api.github.com/repos/boppreh/keyboard/issues/comments/266244408","html_url":"https://github.com/boppreh/keyboard/issues/34#issuecomment-266244408","issue_url":"https://api.github.com/repos/boppreh/keyboard/issues/34","id":266244408,"user":{"login":"boppreh","id":231856,"avatar_url":"https://avatars.githubusercontent.com/u/231856?v=3","gravatar_id":"","url":"https://api.github.com/users/boppreh","html_url":"https://github.com/boppreh","followers_url":"https://api.github.com/users/boppreh/followers","following_url":"https://api.github.com/users/boppreh/following{/other_user}","gists_url":"https://api.github.com/users/boppreh/gists{/gist_id}","starred_url":"https://api.github.com/users/boppreh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boppreh/subscriptions","organizations_url":"https://api.github.com/users/boppreh/orgs","repos_url":"https://api.github.com/users/boppreh/repos","events_url":"https://api.github.com/users/boppreh/events{/privacy}","received_events_url":"https://api.github.com/users/boppreh/received_events","type":"User","site_admin":false},"created_at":"2016-12-10T22:27:32Z","updated_at":"2016-12-10T22:27:32Z","body":"Unfortunately I don't see a way to adapt the library to your needs.\r\n\r\nMy suggestion is to hardcode the mapping `scan_code -> name` yourself, and deal only in scan codes. If you need a shifted character, press and hold shift by using its scan code.\r\n\r\nThe existing code for abbreviations will probably be unable to help you when using scan codes, but you can simply copy, paste and adapt. All in all it's less than 30 lines of code. If you think any of this would be helpful to other users, I would be glad to adapt into the library.\r\n\r\nAnd thank you for the in-depth reports."}}
{"actor":{"display_login":"boppreh"}}