-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Help (shift+?
) keybinding broken on master
#837
Comments
Thanks for the report! This one is surprisingly tricky... Sadly, Windows treats "Shift" + "Key" differently than other systems. Assuming a US QWERTY layout, when you press "Shift" + "/" for a "?", a "Shift" + "?" is provided on Windows. On other systems, it is normalized to just "?". I thought I had handled this inconsistency a few times now, by trying to normalize the input, but I keep breaking different use cases. My latest attempt to address this, was to remove the "Shift" modifier on all ASCII uppercase letters. However, "?" isn't an upper case letter, so obviously that doesn't work. I think a decent solution it to:
|
What's wrong with removing the SHIFT modifier from the incoming event before trying to find the matching keybinding? That's what you did before upgrading crossterm last year and it seemed to work well. It looks like recognizing SHIFT modifier requires support from the terminal as well as the application, possibly not worth it for girt's use case? |
The only real issue is a theoretical keybinding, where Shift + Char is wanted. That was my reasoning behind limiting it to ASCII uppercase characters. It's partially due to me not having or using non-US QWERTY keyboards, and being unsure how they register the shift modifier. But as you stated, getting Shift to be recognized is difficult across platform. You are probably correct, in that it's not worth it. Let me think on it. |
Coming back to this issue, after a bit of a hiatus.
You are correct, it's not worth the effort. I want to do a further refactor of how keybindings are handled, since it is currently fairly fragile (mostly around using However, I would like to get 2.3.0 released, and this is a blocker. To address the immediate issue, I am going to remove the Shift modifier from non-printable characters, and strip the shift modifier from any character events. |
Seems to work fine for me, thanks! |
After 2c3ae58 pressing Shift+/ (i.e. "?") to invoke help doesn't work for me on Windows (in cmd.exe).
In
git-interactive-rebase-tool/src/input/src/event_handler.rs
Line 57 in bdf2f38
event
has the SHIFT modifier enabled, while the configuredself.key_bindings.help
does not.The text was updated successfully, but these errors were encountered: