-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Fixed #521 - AltGr combinations not working #1436
Conversation
Alright... I've spent 5 hours on this thing today. Dammit. I hope it was worth it. 😄 This PR should now be far more robust than my basic solution in #521. This also has the nice side effect of this PR allowing others to continue pressing Ctrl+Alt without it being confused for an AltGr key press. I've also fixed the input tests I believe, which now...
|
This is exciting. Thanks so much for looking at it! We’ll probably get to reviewing this after the weekend. 😄 |
// - a KeyModifiers value with flags set for each key that's pressed. | ||
Settings::KeyModifiers TermControl::_GetPressedModifierKeys() const | ||
// - The combined ControlKeyState flags as a bitfield. | ||
DWORD TermControl::_GetPressedModifierKeys() const |
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.
I think @zadjii-msft was actively avoiding using a loose number of flags for representing this.
Even though Settings::KeyModifiers
is no longer appropriate (given it treats left/right alt/ctrl the same), maybe it's appropriate to either expand it to have a preference (if folks want it and set both alts or both ctrls if the regular alt/ctrl is chosen) or appropriate to make a different more strongly typed flag structure for this.
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.
To be fair, I don't mind it this way.
@miniksa Thank you for your kind review! I've reverted most parts of the changeset and tried to be as minimalistic as possible this time. You'll find that the diff should be easier to read now. I could optimize the code structure here and there to use e.g. switches (like I did originally), but I feel like I might not be following any plans you guys might already have in mind for this project. For now I'd like make this PR simple and leave any larger refactorings to you. 🙂 Except of course... Regarding the Edit: Ah you're already done reviewing. 😅 |
Please, can you review this issue ? For most people in Sweden, Germany and Switzerland the terminal with WSL is unusable at the moment without this patch. |
Also relatively unusable for French users, given that the issue this PR fixes prevents using all sorts of keys. |
Same for Finnish users. Cannot navigate paths as cannot type path separators. |
If you could write a follow on issue or PR to make it into a nice class that does what you say... that would be ideal. For everyone else, I'll try to get someone else to 2nd this and we can correct anything that @zadjii-msft finds disagreeable later when he gets back. |
@miniksa Do you believe it might be possible to get this PR through until the weekend? Coincidentally I'm going to have some free time then and could work on that. But don't worry if it's not possible. We'll find the necessary time/solution either way, right? 🙂 |
@lhecker, I think we could merge it today if I can find someone with 15 minutes to read it. Let me keep trying. We have had meetings this afternoon. |
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.
Thanks so much. This is great.
@lhecker Just noticed this was merged. Thank you so much for submitting a PR and fixing this issue! |
This commit changes how TerminalControl/TerminalCore handle key events to give it better knowledge about modifier states at the lower levels.
This commit changes how TerminalControl/TerminalCore handle key events to give it better knowledge about modifier states at the lower levels.
Summary of the Pull Request
Let's start fixing #521 and the currently broken state of AltGr combinations, as it heavily affects many non-US users of this project.
PR Checklist
Detailed Description of the Pull Request / Additional comments
I'm about 100% sure that this PR is not going to fix #521 by itself, but it's a start. 🙂
If others wan't to contribute to this PR, please feel free to do so. I'll gladly grant push permissions to my fork.
If you want to view the diff here on GitHub I recommend enabling "Hide whitespace changes" in the diff viewer.
Validation Steps Performed
This PR fixes all immediate/obvious issues in regards to AltGr for me in all types of shells I know.
I think it's fairly easy to see why it works, since I simply delegate the handling to
WM_CHAR
instead.