I want my AltGr key to behave exactly like left Alt.
Usually, I do this kind of stuff with Autohotkey, but I\'m open to different solutions.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00
In AHK, Can you do:
LControl & RAlt::!
Or
<^>!::!
If you want to map this key globally and with no need to restart system for every change (but once), you may need to write a keyboard filter driver for this purpose. Look here.
I got a decent behavior by combining two hotkeys:
LControl & RAlt::Send {Alt}
RAlt::Alt
The first one is for the standalone keypress (avoid to hold it down...), the second one to be used as combination (Alt+F, etc.).
It isn't perfect, you can't do a combination like Ctrl+Alt+T, but perhaps it is enough for your needs.
Note that you can do a permanent remapping using the registry. See this forum post for an example. Not sure that it applies to compound keys like this one, but I thought I should mention it...
This worked for me:
LControl & *RAlt::Send {LAlt Down}
LControl & *RAlt Up::Send {LAlt Up}
And this for mapping it to the Windows key:
LControl & *RAlt::Send {LWin Down}
LControl & *RAlt Up::Send {LWin Up}
Registry modification using SharpKeys (see above) is more reliable though (if you have administrator access).
As pointed out by PhiLho, Windows provides a way to remap any key, through the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout
. A basic overview can be found at Scan Code Mapper for Windows. A better description is probably Answers to Scancode Mapping or Changing Key Values.
I'm using this approach to put the Windows Key
on the Caps Lock
, because my keyboard doesn't have a Windows Key
and I don't need the Caps Lock
.