Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Customizing the keyboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Customizing the keyboard
Authored by: Nycta on May 09, '01 03:30:49AM
As a French person working with an American keyboard, I needed a way to have an easy access to accentuated characters. ResEdit makes it very easy to customize one's own keyboard configuration, but MacOS X needs a little more work to be done. Here's a tip I found on http://www.omnigroup.com/mailman/archive/macosx-dev/2000-November/006433.html : 1/ copy a valid font in the (home)/Library/Fonts folder 2/ with Resedit, create a file named myKCHR.rsrc with the customized KCHR and a copy of the adequate itlb (name the KCHR since this is the name that will eventually appear in the International Preference Panel). Put myKCHR.rsrc in your Home directory. 3/ open terminal and type su + password 4/ type /Developer/Tools/DeRez myKCHR.rsrc > /tmp/myKCHR.r 5/ type /Developer/Tools/Rez -useDF -a -o /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Resources/HIToolbox.rsrc /tmp/myKCHR.r 6/ log out, log in and select the new layout in the International Panel of the System Preferences

[ Reply to This | # ]
Customizing the keyboard (swap any key!)
Authored by: Morganizer on Nov 09, '01 06:41:28PM
I recently bought a cheap USB keyboard to replace my OEM dinky keyboard. It's nice having a forward delete key again, but the Command and Option keys are reversed ('cause the keyboard is made for Windows PCs). So I've worked out how to swap the keys in OS10.1. The hack affects the entire system, including Classic. You'll need to install the Developer Tools and sign up with ADC at www.apple.com/developer. So here goes... Download the IOUSBFamily source files: href="http://www.opensource.apple.com/projects/darwin/1.4/source/apsl/IOUSBFamily-1.8.4GMc3.tar.gz">http://www.opensource.apple.com/projects/darwin/1.4/source/apsl/IOUSBFamily-1.8.4GMc3.tar.gz Save the archive in a folder of your choice. Launch Terminal, navigate to the folder you saved the .tar.gz file in and execute the following command: gnutar -xvfz IOUSBFamily-1.8.4GMc3.tar.gz This will create a folder called "IOUSBFamily-1.8.4GMc3.tar.gz". If you get a message about the SCM status operation failing, just click the Disable button (at least, that's what I did; feel free to correct me). Inside the folder is a project file and a bunch of folders filled with libraries. Source code!! Double click on the file called "IOUSBFamily.pbproj" and it will open in Project Builder. Click on the drop down arrow for "AppleUSBKeyboard" and then "Classes". Highlight the item called "cosmo_USB2ADB.cpp". On the right will appear the code for this resource. Scroll down past the header comments and you'll see a list of codes. Each one represents a key. Fortunately for us the ones we're looking for were commented by a considerate programmer. To switch the Command and Option keys, simply swap their position in the list. Thus: 0x3a, // e2 Left option/alt key 0x37, // e3 Left command key Becomes: 0x37, // e3 Left command key 0x3a, // e2 Left option/alt key Do the same for the right hand keys, and then select File -> Save. Now just select Build -> Build from the menu bar. When it's finished there will be a new directory in the "IOUSBFamily-1.8.4GMc3.tar.gz" folder called "build". Inside it are the compiled binaries that you just created from your modified source code. Go back to the Terminal, navigate to the build directory, and then enter the following commands, along with your root password when asked for it: sudo -s cp -R AppleUSBKeyboard.kext /System/Library/Extensions That's it! Just restart your computer and the keys are switched. If your system goes haywire boot to single user mode or perform sudo, then navigate to the /System/Library/Extensions folder and rm -R AppleUSBKeyboard.kext to get yourself back to normal. I'm considering posting the binary on my mac.com account, if someone can reassure me that doing so won't violate the Apple Public Source License. -Morgan morganize_it@mac.com System: G4/350 AGP OSX 10.1 Build: 5L14 Keyboard: Yahoo! USB Hub Internet Keyboard (Sakar Int'l Inc. model# 9001AH)

[ Reply to This | # ]
Customizing the keyboard (swap any key!)
Authored by: antosha on Nov 26, '02 08:31:11PM

Hey, I haven't successfully been able to swap command with option/alt, but to swap Caps Lock and Ctrl on USB mice, you no longer need to rebuild AppleUSBKeyboard.kext, and instead can do the following, taken from From http://ella.slis.indiana.edu/~jfieber/osx/ , look below.

1. Edit /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBKeyboard.kext/Contents/Info.plist and add:

<key>Swap control and capslock</key>
<integer>1</integer>

under IOKitPersonalities/AppleUSBKeyboard. You can, of course, use the PropertyListEditor application that comes with the developer tools to add the property.

2. Remove the file /System/Library/Extensions.mkext. This is a device driver cache. The modified AppleUSBKeyboard driver will not be loaded if this exists. The next reboot will rebuild this file with the modified AppleUSBKeyboard driver. (And the reboot will take a bit longer than normal as it builds the file.)

3. Reboot.

Swiping Option/Command

I tried to use Swipe command option, but it doesn't work. I suspect that I don't have the right names for those keys. Any ideas?

Anthony

anton aaattt jotpuree.com



[ Reply to This | # ]