-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remapping to Alt+Tab/Win+Space style shortcuts #3965
Fix remapping to Alt+Tab/Win+Space style shortcuts #3965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally when we use alt+tab (alt key held down) and we hold down the other alt key as well, on pressing tab, it continues to tab through items till either of the alt keys are released. However, if I remap Ctrl+C -> Alt+Tab, then when ctrl is pressed down and now alt is pressed, the expected behavior would be that till either Ctrl or Alt is released we would be able to tab, however the moment we press Alt, it opens that app.
This is by design, since pressing any key apart from those in the original shortcut (Ctrl+C) so should revert it back to the unremapped state. For an analogous case, if you remap Ctrl(L)+C to Alt+Tab, then while you have already opened it, pressing Ctrl(R) will close it, but if you remap Ctrl+C to Alt+Tab, then pressing the other Ctrl key will show the expected behavior for Alt as you mentioned. The main change with this PR, which was mainly observed for Alt+tab and Win+Space (there might be others too which is why it wasnt hardcoded), is that we are sort of mapping the modifiers as well, so in the example you mentioned it should technically be Ctrl behaving like that, and that works as expected if you remap Ctrl(not L/R version)+C -> Alt+Tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. It makes sense to not have that behavior as you mentioned because we aren't remapping shortcuts which are a part of another shortcut.
Summary of the Pull Request
This PR adds handling for shortcuts which behave like Alt+Tab and Win+Space. These shortcuts behave differently from others since once you invoke Alt+Tab and release Tab, the window switcher remains open as long as Alt is pressed, so if a user remaps Ctrl+C to Alt+Tab we need to make sure as long as Ctrl is held and a user does not press a key apart from C, then Alt should remain as being held to the OS.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Known Issues
Validation Steps Performed
Verified that remapping to Alt+Tab and Win+Space works as expected, and verified that other remaps still work as before.