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.
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 ctrl or win interfering with character inputs #149
Fix ctrl or win interfering with character inputs #149
Changes from 2 commits
6ab53df
4b5fe95
1fafb14
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Does it make sense to express it as?
Which means
ctrl
in Windows andcmd
in macOS.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.
in theory I agree, but the problem is that ctrl is true when using altrgr (maybe that's the actual root issue 🤔) I guess it wouldn't work then.
(see #149 (comment))
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.
https://en.wikipedia.org/wiki/AltGr_key#Ctrl+Alt
Ah well, I guess that's why. AltGr implies
ctrl+alt
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.
Then that could be discarded? It's
command
only if it'sctrl
, notctrl+alt
?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.
how about
!command || ctrl && alt && cfg!(target_os = "windows")
?I believe this behaviour is specific only to Windows. Please correct me if I'm wrong, but I believe that in Linux
altgr
doesn't map toctrl+alt
(I don't have a way to test that atm).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.
According to my manual testing, your suggested change works fine for windows and mac 🎉
I might be able to test the behaviour on a spare raspberry pi but not sure when.
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 meant that maybe
alt
can be included in thecommand
variable computation?Then here just leave
!command
. I mean this because what happens in windows if you doaltgr+c
/altgr+v
? Does it work as as copy/paste sincealtgr
maps toctrl+alt
(if I understood correctly).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.
Following the changes in #156, I mean to integrate it like this:
And then just doing
!control
should work, no? It'll ignore shortcuts, and in macOS chars likectrl+a
will skip because the inner!event.char.is_control()
check. But, in macOS this will allowctrl+_
usages that actually produce some character, like:ctrl+´ => "
.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.
@doup I'd prefer the
altgr
behaviour to be limited just to Windows, as I haven't found any proof that it works like that on any other platform. I haven't invested enough time to understand howctrl+_
works in MacOS, but on my ANSI MacBook keyboard I haven't found a single button that produced a character in combination withctrl+_
.I'll stick to this solution for the time being, but I'm open to revisiting it if any other issues are found.