Ady's OS 9 on Mac Mini site!
Remapping Modifier Keys on Mac OS 9
I wanted to remap my modifier keys in Mac OS 9, but I couldn't find much documentation about this online. I'll document here what I found and how I got it working.
I've seen (and got my solution partially from) swapping the Command and Option keys, as documented here. This is useful if you want to convert a Windows style keyboard to the Mac style layout—Command next to Space.
Instead, I wanted to swap Command and Control on my Windows style keyboard, as I like having Command mapped to the bottom left corner of my keyboard, for windows-like shortcuts as that's what I grew up learning, and I use linux daily with this configuration too.
Alright, down to business:
- So if you want to swap keys, you'll need to know the codes to swap. Below is an image from this dense but enlightening Apple developer document that will show what keys correspond to what codes. I wanted to swap Command and Control, which are
3b
and37
. (Lower case used here to make it clear: Control is represented by3b
and not38
.) Note down anything you wanna swap.
-
Next, you'll want the software SuperResEdit (I would bet ResEdit works too, but I used the former).
-
Open your
System Folder
and copy the file inside there calledSystem
to your desktop or somewhere else safe. You can't edit the currently in-use version, so we gotta make a copy.
Now duplicate that file, and call itOriginal System
and DON'T touch that one in case you screw anything up; you're gonna be hex editing stuff AND messing with your keyboard layout, so you'll want an easy backup you can revert to, even if only your mouse works. -
Open
System
(the copy on your desktop that you wanna modify) in SuperResEdit. You'll get a big array of icons with 4-character identifiers, each of which contain lots of data and constants that make the OS work. -
Find the
KMAP
resource with a little keyboard icon, and open it up. You'll get a new window with a few resources, and you'll wanna open number2
in a new window. It should look roughly like the image below.
-
If you're not familiar with SuperResEdit or hex editors, be cautious, and only change what you need to here.
See how the bottom line of data,000088
, is exactly one full line just like all the ones above it? Make sure it also looks like that after you edit it; you don't wanna cut anything out or add extra data where it's not expected. -
Anyways, I wanna swap
3b
and37
, and I've already done that in the screenshot above. Before the edit, the highlighted section said3B37
; I deleted that and typed in373B
instead.
Note that in this hex editor, backspace will delete two characters at a time because of how the data is structured. -
Close out those two most recent windows until you get back to the one with the big list of icons where you first found
KMAP
. It's fine to close these windows, as this whole process is just editing one big file, theSystem
file, and you'll save all your changes at the end. -
Find and open
ROv#
, then open the resource inside it to get a window like below.
-
Scroll all the way to the bottom and click the very last
*****
to select it. Press Command-K to create a new entry below that. With your keyboard, enterKMAP
as the TYPE and2
as the RES ID. The above image shows the window after these changes have been made. -
Save the file.
-
To test your changes, go back to your
System Folder
and drag theSystem
file there to the trash. Now, drag the new editedSystem
file from your desktop into theSystem Folder
as the new active file. -
Reboot, and your changes should be active. If you messed something up, make another duplicate of
Original System
and start over at step 4, editing that until you figure it out. If it did work, congratulations! Enjoy using your system how you prefer.