{"action":"created","issue":{"url":"https://api.github.com/repos/openstenoproject/plover/issues/380","repository_url":"https://api.github.com/repos/openstenoproject/plover","labels_url":"https://api.github.com/repos/openstenoproject/plover/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/openstenoproject/plover/issues/380/comments","events_url":"https://api.github.com/repos/openstenoproject/plover/issues/380/events","html_url":"https://github.com/openstenoproject/plover/pull/380","id":136145265,"number":380,"title":"OSX: Send key codes instead of strings when possible","user":{"login":"morinted","id":5840970,"avatar_url":"https://avatars.githubusercontent.com/u/5840970?v=3","gravatar_id":"","url":"https://api.github.com/users/morinted","html_url":"https://github.com/morinted","followers_url":"https://api.github.com/users/morinted/followers","following_url":"https://api.github.com/users/morinted/following{/other_user}","gists_url":"https://api.github.com/users/morinted/gists{/gist_id}","starred_url":"https://api.github.com/users/morinted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morinted/subscriptions","organizations_url":"https://api.github.com/users/morinted/orgs","repos_url":"https://api.github.com/users/morinted/repos","events_url":"https://api.github.com/users/morinted/events{/privacy}","received_events_url":"https://api.github.com/users/morinted/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openstenoproject/plover/labels/needs-testing","name":"needs-testing","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T18:24:25Z","updated_at":"2016-02-24T19:03:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openstenoproject/plover/pulls/380","html_url":"https://github.com/openstenoproject/plover/pull/380","diff_url":"https://github.com/openstenoproject/plover/pull/380.diff","patch_url":"https://github.com/openstenoproject/plover/pull/380.patch"},"body":"### About\r\n\r\nChange `osxkeyboardcontrol.py` to use key codes based on the user's current layout, instead of just setting the string and sending key code 0. I imported `mac_layout.py`, a creation from @willwade where he used the base code in `PyKeycode` for the purpose of porting over functionality to `PyUserInput`. Because that code is not published, I had to copy and add attribution instead of some clever `import`. The new OSX `send_string` also tries to group modifier presses to avoid to avoid unnecessary key presses, as would be in the case of sending in all CAPS output.\r\n\r\n### Issues\r\n\r\nFixes #246, which in turn has a couple of results for a typical Mac user. I've noticed the keycodes to be helpful in the following specific cases:\r\n\r\n- Plover no longer crashes when it emulates keypresses onto itself\r\n- Anki accepts input instead of just seeing 'a' for every key sent\r\n- KDiff3 has the same behavior as Anki\r\n- The typing website, 10fastfingers, now works with Plover on OSX\r\n- Key-bindings with modifiers now work on the Atom-editor's Vim-mode plugin\r\n\r\n### Release Notes\r\n\r\n- Broaden supported applications on OS X (Anki, KDiff3, 10fastfingers.com)\r\n- Bug fix: OS X commands are now layout-independent (before, they were hardcoded to QWERTY)\r\n\r\n### Tested Platforms\r\n\r\nI only tested on OS X, assuming that the code will not affect other platforms."},"comment":{"url":"https://api.github.com/repos/openstenoproject/plover/issues/comments/188407356","html_url":"https://github.com/openstenoproject/plover/pull/380#issuecomment-188407356","issue_url":"https://api.github.com/repos/openstenoproject/plover/issues/380","id":188407356,"user":{"login":"morinted","id":5840970,"avatar_url":"https://avatars.githubusercontent.com/u/5840970?v=3","gravatar_id":"","url":"https://api.github.com/users/morinted","html_url":"https://github.com/morinted","followers_url":"https://api.github.com/users/morinted/followers","following_url":"https://api.github.com/users/morinted/following{/other_user}","gists_url":"https://api.github.com/users/morinted/gists{/gist_id}","starred_url":"https://api.github.com/users/morinted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morinted/subscriptions","organizations_url":"https://api.github.com/users/morinted/orgs","repos_url":"https://api.github.com/users/morinted/repos","events_url":"https://api.github.com/users/morinted/events{/privacy}","received_events_url":"https://api.github.com/users/morinted/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T19:03:06Z","updated_at":"2016-02-24T19:03:06Z","body":"I was having issues with transpositioning (`gabrled` text output) while developing this, hence the addition of the timestamp modifications. I'm trying to get @stanographer to test it out today to see if the issue is resolved in a build with this code."}}