Method 1: Use SharpKeys
You could use SharpKeys to remap your keys. This changes the registry for you and allows you to easily manage key mappings.
Add on the main screen
Map this key click
Type Key and press Ctrl
To this key find and click
Write to Registry and then logout
Note: You may have to do steps 1-4 again for Caps to Ctrl
Edit: It appears that the key AltGr is not supported by SharpKeys. However, this answer is still valid for other keys so I will leave it for informational purposes. The registry method of rebinding, outlined below, works for this key remap.
Method 2: Use the Registry
If you want to do it via the registry you can do:
00 00 00 00 00 00 00 00 03 00 00 00 aa aa bb bb aa aa bb bb 00 00 00 00
It's a bit complicated but I will try to explain. For remap 1,
aaaa is the scancode of the key you want to map to.
bbbb is the scancode of the key you want to map from. Same thing for remap 2. This is what you would put into the registry key
ScancodeMap and what
SharpKeys does for you.
A table showing the values and meaning of the DWORDS:
Value: Interpretation: Entered as:
DWORD 1 0x00000000 Header: Version. Set all to zeroes 00 00 00 00
DWORD 2 0x00000000 Header: Flags. Set all to zeroes 00 00 00 00
DWORD 3 0x00000002 Number of entries in the map, including null terminator 02 00 00 00
DWORD 4 0x003A0000 Remove CAPS LOCK (0x3A --> 0x00) 00 00 3A 00
DWORD 5 0x00000000 Null Terminator 00 00 00 00
In the above table, the mapping of Caps Lock is an example. Also, thanks to @Guitar Shoe Dave for the suggestion.
In your case the value would be:
00 00 00 00 00 00 00 00 03 00 00 00 1d 00 3a 00 1d 02 1d 00 00 00 00 00
Note: You'll have to logoff and back in again to see the resulting changes.