wayland: fix keycodes of swapped xkb modifier keys #5085
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When using xkb to swap modifier keys on Wayland, SDL did not correctly translate scancodes into keycodes. This pull-request attempts to fix that.
This bug seems very similar to #3471 which was closed in #4303. However, trying to checkout that particular commit results in a broken
checkkeys
app on Sway (window is not shown) so I'm unable to test if the bug was still reproducible at that point.Steps to reproduce
This step is compositor specific, but on
sway
this can be configured using theXKB_DEFAULT_OPTIONS=ctrl:swapcaps
environment variable (this needs to be set before starting the compositor).test/checkkeys
app and press/release once the physical caps-lock key (which has been remapped to left-control).Before the changes in this pull-request, the (wrong) output will be:
After these changes, the (correct) output will be:
Existing Issue(s)