PowerToys: [KBM] Right Alt Gr key stopped working after switching left Ctrl/Alt keys

Environment

Windows build number: Microsoft Windows [Versione 10.0.18363.836]
PowerToys version: v0.18.0
PowerToy module for which you are reporting the bug: Keyboard Manager

Steps to reproduce

    • Map key Ctrl (left) to Alt (left)
    • Map key Alt (left) to Ctrl (left)
    • Press Alt Gr (Right Alt Key) + Any key (for example @ on Italian Keyboard )

Actual VS Expected behavior

Before the remapping Alt Gr + @ works and output a @ while after the remapping the Right Alt key behaves like a regular Alt Key so the output is ò. I’ve even tried to remap Alt (right) + ò to Alt (Right)+Ctrl (Right)+ò but still not working.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 5
  • Comments: 20 (6 by maintainers)

Most upvoted comments

How is this still an issue, over 3 years later…?

I read in #3641 that this issue will be considered in v1. For now this easy tweak can solve the issue. I, as a user who is used to the nice location of cmnd key in Mac OSX, wanted to switch Left-Ctrl and Left-Alt with PowerToys. And then, remap the shortcuts (Alt+Tab with Ctrl+Tab) and (Alt+F4 with Ctrl+Q), so that I get exactly the functionality similar to Mac OSX. But doing so, messes up the Right-Alt (Alt Gr) as well. This is a problem specially if your keyboard is not English, thus, you need Alt Gr to type certain characters. The solution was to change ONLY the left Ctrl and left Alt using the registry method (e.g. the method described here). And then, use PowerToys to change the above shortcuts (and not using the Remap functionality). Until a fix from PowerToys, this will resolve the issue.

After digging more into this, it turns out Alt Gr is internally just Ctrl (Left) + Alt (Right) at the virtual key level. When using English US keyboard Alt Gr behaves like a normal Alt (Right), but it changes for other languages. Which is why if you remap Ctrl (Left) it will affect Alt Gr as well. In order to support this particular use case we would have to look into scan code based remaps rather than virtual key code. @saahmedm what do you think about this issue?

Good Point 😄 I now used Sharpkeys to change the regentries, works like a charm.

Note that the physical key-press itself registers as LCtrl and RAlt when captured.

That’s the cause of many issues. Most people just don’t know that AltGr = (L)Ctrl + ®Alt and many remap their (left) Ctrl keys…

Americans don’t use alt gr, thus don’t care.

@micc83 Can you create a separate issue for the crash you were facing. It looks like there’s definitely some bug, because even if you ignore the warnings, { "originalKeys": "165;192", "newRemapKeys": "165;192" }, shouldn’t be possible. Edit: I was able to reproduce it by doing what you mentioned. It looks like PowerToys crashes.

I’ve reset first the remapShortcuts.global property, the error was still there. I then deleted remapKeys.inProcess and it started working back.

Sure, I was already doint it 😄

Ps. Cool you’re using json for storing configs… I was expecting some binary…

default.json

{
    "remapKeys": {
        "inProcess": [
            {
                "originalKeys": "20",
                "newRemapKeys": "162"
            },
            {
                "originalKeys": "164",
                "newRemapKeys": "162"
            },
            {
                "originalKeys": "162",
                "newRemapKeys": "164"
            }
        ]
    },
    "remapShortcuts": {
        "global": [
            {
                "originalKeys": "165;192",
                "newRemapKeys": "165;192"
            },
            {
                "originalKeys": "162;9",
                "newRemapKeys": "164;9"
            }
        ]
    }
}

Possibly related to #3641.