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.
I tried this:
LControl & RAlt::Alt
And Autohotkey displayed error about Alt
not being recognized action.
Then I tried the following code:
LControl & RAlt:: Send {Alt down} KeyWait LCtrl KeyWait Ralt Send {Alt up} return
which sort of works - I'm able to use the AltGr key for accessing hotkeys, but it still behaves differently:
When I press and release the left Alt, the first menu item in the current program receives focus.
Pressing and releasing AltGr with this script does nothing.
Any ideas? Is this even possible with Autohotkey? (remapping right Ctrl and Shift to their left siblings was piece of cake)
Alt
to LAlt
in the code and it made no difference.
The key combination [Ctrl] + [Alt] offers the same function as Alt Gr. In this way you can make use of so-called “third characters.”
The combination Ctrl+Alt is also known as AltGr, and it acts as an alternate shift key. For example, consider the German keyboard layout. Notice that there are three keyboard shift states (Normal, Shift, and AltGr), whereas on U.S. keyboards there are only two (Normal and Shift).
Using it is rather straightforward. Just like how you use the Control key for Ctrl + C, you can use ALT GR + key which also houses the special or the accented letter. Windows allows emulating Alt GR when you press Ctrl + Alt keys together.
Thank you all for answers. I was unable to solve this using AutoHotkey -- PhilLho's answer was close, but I really needed exatly the same behaviour as with left Alt key.
However, the registry thing actually worked as I needed.
Save this as AltGR_to_LeftAlt.reg file and run it:
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
Or, there is a GUI tool that does this for you -- it's called SharpKeys and works peachy:
Oh, and don't forget to reboot or log off -- it won't work until then!
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With