For my keyboard layout, I've grown used to having they key right next to my space be Alt-Car (right). Now that I'm on a Mac keyboard, it's Command. Is there any way to map only the right command key to alt-car (right)?
Mac – Remapping right command key to right alt in Mac
keyboard-layoutkeymapmac
Related Solutions
The answer was as easy as this:
- Click the Apple logo in the top left of your screen
- Select "System Preferences"
- Select "Keyboard"
- Make sure the "Keyboard" "tab" is selected
- Select the "Modifier Keys..." button in the bottom right of the window
- Select keyboard: "USB Keyboard" (probably - if you're like me, you're trying to configure a keyboard that's plugged in to your laptop)
- Switch the "Option" and "Command" values
Since Microsoft Keyboard Layout Creator (MSKLC) 1.4 fails to work properly you can use the following low-level solution that is derived from information on (German) WinFAQ.
Create the following two .reg
files with a text editor of your choice and execute them alternately to load the given keys/values into your Windows' Registry:
HKLM^SYS^CCS^CTRL^Kbd_Layout^Scancode_Map#Swap_R-Win_R-Alt.reg
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,\
03,00,00,00,\
38,e0,5c,e0,\
5c,e0,38,e0,\
00,00,00,00
HKLM^SYS^CCS^CTRL^Kbd_Layout^Scancode_Map#Reset.reg
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,\
01,00,00,00,\
00,00,00,00
Note the reversed order of LSB (least significant byte) and MSB (most significant byte) within the 2 bytes of a scancode, a.k.a. little-endian. Note also the backslash character (\
) for line continuation.
You have to restart Windows/reboot your machine for a change of mappings to take effect.
Technical Background Info
Scancode Map
entry:
┌──────────┬──────┬─────────────┬───────────────────────────────────────────────────┐
│ Bytes | Size | Values │ Description │
├──────────┼──────┼─────────────┼───────────────────────────────────────────────────┤
│ 0 … 3 │ 4 | 00 00 00 00 │ Header: version info, always all 0 │
│ 4 … 7 │ 4 | 00 00 00 00 │ Header: flags, always all 0 │
│ 8 … 11 │ 4 | 0m 00 00 00 │ Header: mappings count[c] + 1 [for the trailer] │
│ 12 … s │ c×4 | LN¹HN²LO HO │
New /
Old scancodes in little-endian byte order │
│ t … t+3 │ 4 | 00 00 00 00 │ Trailer (t = s + 1 = 12 + c × 4) │
└──────────┴──────┴─────────────┴───────────────────────────────────────────────────┘
¹ L ... low byte, least significant byte (LSB)
² H ... high byte, most significant byte (MSB)
See the following pages/documents for scancodes:
- WinFAQ: ScanCodes der Tasten (German; scancodes' byte order is already reversed there and such ready for entering into
.reg
files or directly into the Registry via Windows' Registry Editor) - Andries Brouwer: Keyboard scancodes
- Microsoft: Windows Hardware Dev Center Archive:
- Input / HID Archive: Keyboard Scan Code Specification (DOC)
- USB and 1394 Archive: USB HID to PS/2 Scan Code Translation Table (PDF)
Best Answer
Have you tried keyremap4macbook ?
By checking the option:
I am using the right command as meta/alt key throughout mac os.