{"action":"created","issue":{"url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/502","repository_url":"https://api.github.com/repos/keyboardio/Kaleidoscope","labels_url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/502/comments","events_url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/502/events","html_url":"https://github.com/keyboardio/Kaleidoscope/pull/502","id":391812940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5MjIzNDYz","number":502,"title":"Allow plugins to modify live_composite_keymap_","user":{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-17T17:21:42Z","updated_at":"2018-12-18T16:33:32Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/keyboardio/Kaleidoscope/pulls/502","html_url":"https://github.com/keyboardio/Kaleidoscope/pull/502","diff_url":"https://github.com/keyboardio/Kaleidoscope/pull/502.diff","patch_url":"https://github.com/keyboardio/Kaleidoscope/pull/502.patch"},"body":"This change allows plugins to call `handleKeyswitchEvent()` with a `mappedKey` value other than `Key_NoKey`, and have that value stored in `live_composite_keymap_` instead of looking up the value on the top active layer for that key. This would make it possible for a plugin to set the `Key` value of a key to something other than what's in the keymap, and not have to change it every cycle while the key is held in order for it to stay that way.\r\n\r\nThe known problem that this addresses is a bug that prevents layer-shift keys from working properly with Qukeys, which stores an alternate `Key` value, which is layer-specific, for each `Qukey` object. It calls `handleKeyswitchEvent()` so that other plugin hooks will be called, and specifies a `mappedKey` value to override what's in the keymap. The problem is that if the alternate `Key` value is `ShiftToLayer(N)`, when the next scan cycle comes around, Kaleidoscope indicates that the layer the key is mapped from is `N`, even though that's not where the still-held key's entry in `live_composite_keymap_` came from. Thus Qukeys doesn't recognize that it's a qukey (or possibly identifies it as some other qukey), and doesn't update `mappedKey` appropriately. The end result was shifted layers getting stuck on.\r\n\r\nThis isn't the only possible fix, but it is by far the simplest.\r\n\r\nFixes #501."},"comment":{"url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/comments/448283364","html_url":"https://github.com/keyboardio/Kaleidoscope/pull/502#issuecomment-448283364","issue_url":"https://api.github.com/repos/keyboardio/Kaleidoscope/issues/502","id":448283364,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODI4MzM2NA==","user":{"login":"gedankenexperimenter","id":17190757,"node_id":"MDQ6VXNlcjE3MTkwNzU3","avatar_url":"https://avatars0.githubusercontent.com/u/17190757?v=4","gravatar_id":"","url":"https://api.github.com/users/gedankenexperimenter","html_url":"https://github.com/gedankenexperimenter","followers_url":"https://api.github.com/users/gedankenexperimenter/followers","following_url":"https://api.github.com/users/gedankenexperimenter/following{/other_user}","gists_url":"https://api.github.com/users/gedankenexperimenter/gists{/gist_id}","starred_url":"https://api.github.com/users/gedankenexperimenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedankenexperimenter/subscriptions","organizations_url":"https://api.github.com/users/gedankenexperimenter/orgs","repos_url":"https://api.github.com/users/gedankenexperimenter/repos","events_url":"https://api.github.com/users/gedankenexperimenter/events{/privacy}","received_events_url":"https://api.github.com/users/gedankenexperimenter/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T16:33:32Z","updated_at":"2018-12-18T16:33:32Z","author_association":"CONTRIBUTOR","body":"I'm assuming that this PR will take some time for review before it is merged (or rejected). Would you like me to leave it as is, or should I also include the changes to Qukeys that the new function allows? I could submit those changes as a separate PR, but I don't know which would be preferred, given that making the Qukeys changes on their own would still compile, but would be horribly broken."}}
{"actor":{"display_login":"gedankenexperimenter"}}