Skip to content

Archive for July, 2005


Display Rotation Script

One of my favorite features of Tiger is the ability to rotate the display. My fabulous friends and family got me a Dell 2005FPW for my 30th birthday, and being able to rotate it to read code and research papers is a tremendous treat.

However, I find it a nuisance to click the display preference Rotate pop-up button, then turn the display, and click the confirm button before my 15 seconds are up.

To simplify that interaction, I’ve written two scripts to do the clicking for me. One rotates clockwise, the other counter-clockwise. If you think that would be useful to you as well, please, help yourself. Add them to your Finder applescript menu, or add them to a hot key launcher (in my case, I added two Triggers to Quicksilver)

Update 2007.01.10: I’ve tested the scripts in Leopard (10.5.x) and everything still works.

Update 2006.03.04: I’ve modified the scripts to handle rotation of displays with the same name. (thanks for the pointer David!) Please download them again and overwrite the old scripts.


Swapping Modifier Keys Seperately on a Notebook and External Keyboard in Mac OSX Tiger

I finally upgraded to Tiger this weekend. It went painlessly, which is always a surprise to me. I feel like upgrading an OS is like a driver and passenger swapping places at 60 mph on deadman’s curve.

There has been plenty said about Apple finally including the ability to trivially swap modifier keys in the new Keyboard & Mouse Preference panel. As a result, it seems uControl development may cease. However, the common complaint from many users has been that they can not swap modifier keys on a per-keyboard basis. I use a external keyboard with my PowerBook when at my desk and need the command and option swapped on it, but not on my PowerBook. Here is my procedure for remedying this.

Note: This only works on older model PowerBooks and iBooks that used ADB keyboards. I do not have a solution for USB keyboard equipped PowerBooks. To find out if this will apply to you, run this command:

kextstat | grep

If you see a line that looks something like this:

57    0 0x2e3e8000 0x4000     0x3000 (2.3.8f2) <44 20 11>

Then your notebook is compatible with this hint.

The trick is to swap the the Command and Option keys for the built-in keyboard in the low-level keyboard driver and then use the Keyboard & Mouse Preference pane to swap them again. This results in the keys being swapped on both the external and the built-in keyboards.

I used the information on Heiko Hellweg’s site to do this.

Follow Heiko’s instructions as if you wanted to remap the ‘enter’ key and instead, or in addition to, when editing the ADBVirtualKeys plist key,
replace the one 0x37 with 0x3A and the following occurrence of 0x3A with 0x37.
This swaps Command and Option in the ADB driver.

As per Heiko’s instructions, delete the kernel extension caches and reboot.

Then you can go into the Keyboard & Mouse Preference pane and swap the modifier keys there. This should result in your external and built in keyboards having the correct arrangement of Command and Option.

I also had to edit all of my ControllerMate mouse button mappings to send Option instead of Command since the events sent by ControllerMate are still interpreted by the keyboard driver which now translates all Command presses into Option presses.