I came across some really strange behavior in Windows 7. I usually have open a remote desktop connection to another Windows (Win 7 or 10) machine. Nevertheless, I mainly work on the local machine. Everything, including the Alt Gr key works perfectly. Now let's say I lock my PC by pressing Ctrl+Alt+Del and unlock it again, the Alt Gr key just does not work anymore. I need to Alt+Tab to the Remote Desktop Window, then Alt+Tab back to some local program like some browser and - voilá - it works again.
This is a problem as some characters on a German keyboard can only be accessed by using the Alt Gr modifier key. When entering passwords I don't usually see what characters I type, so this causes failed login attempts.
Note that I already completely re-installed Windows on both the remote machine as well as the local machine and it does not seem to depend on which remote machine I am connected to. (However, I cannot tell if this also happens when connecting to remote machines running other OSes.) And, of course, when I am not connected to any RDP session, I don't have any issues with that key.
While researching on this issue I stumbled upon this link, unfortunately it does not provide a solution: https://forum.devolutions.net/topic9714-altgr-key-disabled-by-rdm.aspx
Some (German) Microsoft help page suggested to switch the "Apply Windows key combinations" in the RDP settings to "On this computer" - however, it does not change anything.
Any further suggestions?