Skip to content
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

Right CTRL automatically presses [Alt] in Emacs #36

Closed
timo-a opened this issue Nov 13, 2020 · 6 comments
Closed

Right CTRL automatically presses [Alt] in Emacs #36

timo-a opened this issue Nov 13, 2020 · 6 comments

Comments

@timo-a
Copy link

timo-a commented Nov 13, 2020

Hi,

when I open emacs and press e.g. C-x (that hold down ctrl and then press x as well) and I use the right ctrl (left works!) Emacs shows C-M-x (M usually maps to [Alt]) as being pressed and acts accordingly (no such command).

Also the capslock key does not work as intended, I think it is mapped to C-u.

Edit: I'm using v0.5.1 (6b211f) and Emacs 27.1

@MaxGyver83
Copy link
Owner

Hi @timo-a ,

thanks for your report. I'll try to reproduce it.

@MaxGyver83
Copy link
Owner

when I open emacs and press e.g. C-x (that hold down ctrl and then press x as well) and I use the right ctrl (left works!) Emacs shows C-M-x (M usually maps to [Alt]) as being pressed and acts accordingly (no such command).

I can confirm this.

Also the capslock key does not work as intended, I think it is mapped to C-u.

For me it works as expected (as a level 3 modifier). What happens when you enter for example CapsLock+f? When you hit CapsLock only, do you see C-u in Emacs's status bar?

@MaxGyver83
Copy link
Owner

when I open emacs and press e.g. C-x (that hold down ctrl and then press x as well) and I use the right ctrl (left works!) Emacs shows C-M-x (M usually maps to [Alt]) as being pressed and acts accordingly (no such command).

This bug does not occur in version 0.4. Maybe you can use it until this issue is fixed?
@fw623 : I suppose this bug was introduced with this pull request. Do you have an idea, how to fix it (without reverting your PR)?

@timo-a
Copy link
Author

timo-a commented Nov 23, 2020

When I press Capslock alone, nothing is shown in the status bar.
When I press Capslock-a, Capslock-s, Capslock-d, Capslock-f, Capslog-g (where "asdfg" mean what is printed on the physical keys, not a virtual mapping) on either "neo" or "qwertz" the following happens:

Capslock + statusbar
a C-M-ß
s / is typed out
d C-u 7-
f C-u 0-
g * is typed out

I can confirm that right ctrl works in v0.4, however the Capslock bug occurs there as well

@fw623
Copy link

fw623 commented Nov 24, 2020

@fw623 : I suppose this bug was introduced with this pull request. Do you have an idea, how to fix it (without reverting your PR)?

Honestly, I don't know without trying out stuff. But I currently don't have time for that.

Though one (possibly key) difference I noticed is that in master we call handleSystemKey before handling the neo modifiers. Whereas in v0.4 we handle mod3 and mod4 before looking at the system keys. Though quite a fair bit has changed about that handling in general, so that might not be the cause.

When I press Capslock-a, Capslock-s, Capslock-d, Capslock-f, Capslog-g (where "asdfg" mean what is printed on the physical keys, not a virtual mapping) on either "neo" or "qwertz" the following happens: [...]

As for this, the keypresses that are sent is actually what I'd expect. \ is AltGr + ß (= Ctrl + Alt + ß) on my keyboard (German QWERTZ) and {/} are on AltGr + 7/AltGr + 0. While / and * can be reached by just shifting.

I remember that I had some problems in VSCode in Windows with } and \ since they'd trigger a shortcut instead of typing the character. Maybe that's related to your situation.

Maybe it's worth looking into sendChar and trying around with how that's handled. A potential problem I see there is that the necessary modifier keys are pressed and then released once for the press and then again for the release. So maybe if we only send the modifiers on keyDown events (e.g. if (!isKeyUp && altgr) sendDown(VK_RMENU, 56, false); instead of if (altgr) sendDown(VK_RMENU, 56, false);). It could also be that some isExtended is incorrect in a sendDown/sendUp there.

@MaxGyver83
Copy link
Owner

Fixed in v0.5.2
Please re-open if it doesn't work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants