Skip to content

Recent Articles

9
Jun

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

Previously, I used the method described on Heiko Hellweg’s site to modify the internal keyboard driver of the PowerBook, then use the Keyboard & Mouse Preference Pane to swap the modifier keys again. This resulted in consistent modifier key behaviour on both the built-in keyboard, and on the external keyboard.

Well, OrderedBytes has released a new version (v.4) of ControllerMate, which simultaneously disabled the previous method and opened up a new method. ControllerMate v4 includes it’s own ADBKeyboard driver which overrides the built-in one. I discovered this when I upgraded to v4 and immediately my modifier keys were back to normal. I wrote OrderedBytes, and Ken wrote back to say:
“CMv4 contains a custom ADB (and USB) keyboard and mouse driver to implement the “Controller Configurations”. This should allow you to redefine keyboard keys (such as swapping the command/option keys, or the control/caps-lock keys). These controller configurations work on a per-keyboard basis so any changes made to the internal keyboard do not affect any external keyboards that you have attached.
If you want to use your own version of Apple’s ADB keyboard driver (and it sounds like you do), there are a few ways that you can do it. The easiest is probably just to delete the CMADBKeyboard.kext driver from inside the ControllerMate.kext. This will have no ill effects on anything else in ControllerMate.”

However, instead of disabling the driver, I decided to use the new features of ControllerMate to re-enable my modifier keys configuration. Using ControllerMate to manage the PowerBook’s built-in keyboard means that now the built-in/external consistent modifier key behavior is available to new USB-keyboard-based PowerBooks as well as older ADB-keyboard-based PowerBooks. As of this writing, ControllerMate is not yet Intel-compatible, but Ken has said that is the next priority, at which point it should work for MacBooks as well.

– If you previously modified your AppleADBKeyboard.kext as described in the original posting, you can return it back to it’s original condition if you wish.

– Install ControllerMate v4.

– After rebooting, and launching ControllerMate, (and registering it), make sure the “Palette” window is visible and that the drop-down is set to “Controllers”

– Drag your built-in keyboard (labeled “Keyboard Apple”) from the Palette to the main ControllerMate Editor window. Drop it on the left half of the window below the Buttons labeled “Programming, Controller Types, Virtual Controllers”
Drag your built-in keyboard from the Palette to the main ControllerMate Editor window.

– Select the Keyboard controller configuration you just added to the Editor

– Select “Keypad LeftAlt” in the table on the right
Select 'Keypad LeftAlt' in the table on the right

– Select Keypad Left GUI” from the “Behavior” drop-down list
Select Keypad Left GUI

– do the same for “Keypad Left Gui” (Select “Keypad LeftAlt” as the Behavior)

– do the same again for “Keypad Right Gui” (Select “Keypad RightAlt” as the Behavior)

– do the same for “Keypad RightAlt” (Select “Keypad Right Gui” as the Behavior)
Completed configuration

– Save the configuration

– Under ControllerMate’s Preferences, make sure that “Enable ControllerMate Helper” is checked

– If you haven’t already, open the “Keyboard & Mouse” System Preference and under the “Keyboard” tab, click the “Modifier Keys…” button and then swap the Command and Option keys.

This method should work on new and old PowerBooks alike, and once a Universal version of ControllerMate is released, it will work for MacBooks as well.

27
Feb

KGTD and Next Actions in iCal

Update: Ethan has included this functionality in the latest version (0.83) of KGTD. I’ll leave this up for anyone who doesn’t want to upgrade yet.

I love, and live by, Ethan Schoonover’s KGTD. However, I also use my Treo to take care of tasks while commuting. However, KGTD doesn’t sync tasks into iCal so that I can identify Next Actions in each Context. So I modified Ethan’s code slightly, and now Next Actions sync as “important” priority tasks, and all other tasks have no priority.
I’m certain Ethan will include a similar feature in the next version of KGTD, but if you need this functionality right now, you can download the modified version of the Sync script.
Modified 0.75.2 Sync.script
To install it, after uncompressing it:

  • Run the current Sync script from KGTD, and then sync all your devices to make sure all your data is in place.
  • Quit KGTD
  • Backup your iCal data, and KGTD just incase something unexpected happens
  • Delete all your tasks in iCal. This prevents duplicate tasks
  • Open the “/Library/Scripts/Applications/OmniOutliner Pro/Kinkless” folder.
  • Rename “Sync” to “Original Sync”
  • Copy the modified “Sync” to the Kinkless folder
  • I’ve only modified a couple of lines in Ethan’s script, but something unexpected might still go wrong. You use this script at your own risk; I am not responsible for any lost data. That said, I’ve been using it daily for months without any problems.

    26
    Feb

    Safari Google Toolbar-like Highlighting

    I find using a web browser to be a more pleasant experience when I can use the Google Toolbar. The features that make using it so much more pleasant is being able to pinpoint where in the result document my query terms appeared. I feel like it enables me to quickly get at the “meat” of the information I’m searching for. I love Safari, but have used Firefox because the Google Toolbar is available for it. Thanks to Pierre-Luc Samuel’s superb Ultimate Highlight Bookmarklet 1.5b, I was well on my way to getting my beloved highlighting back. My only problem with it was that I often write more specific queries to Google; most often including quoted phrases. Unfortunately, his Safari-compatible Bookmarklet didn’t handle quoted phrases. Below is my update to his bookmarklet that now supports quoted phrases as well.
    Highlight (Note: Bookmarklet updated March 04, 07)
    Drag the link above to Safari’s Bookmark Bar. I recommend dragging it all the way to the left on the Bookmark Bar. If you do, you can simple hit Command-1 and quickly launch and, when hit again, quit the highlighting of your last search phrase.
    The Bookmarklet has a few problems, the most important of which is that it relies of the google referrer link to provide the query terms. If you run it from a page that you didn’t connect to from a Google results page, you’ll have to enter the terms you want highlighted by hand.

    24
    Jan

    Working at Night

    I tend to work very late into the night. I just got a LightWedge Night Vision to help me read in bed. It works very well and means I can fall asleep reading in bed instead of at my desk. I sometimes code or write on my PowerBook in bed too, and Brightness Control is invaluable for this. I also use a Dell 2005FPW at my desk, and Brightness Control is equally valuable there to reign in the extreme brightness of that display. Using this new book light has made me wish the display would dim into the red more. My best guess is that Splasm uses the Cocoa ColorSync framework to dim the display. I imagine it wouldn’t be too hard for them to add a red or a blue-green slider, though I imagine that would be confusing for novice users. Perhaps just a “Red” and/or a “Blue-Green”, or a “Night-Vision” checkbox would be enough.

    18
    Dec

    Pandora bookmarklet and widget

    I love using Pandora. Here’s a bookmarklet to put into your bookmarks bar to launch the player quickly. I spent some time trying to write a Dashboard widget for this player too, but because it’s Flash, and Dashboard doesn’t support interactive Flash very well, and because I don’t have the player’s code, I scrapped it.

    10
    Oct

    ELBT595 and the Treo 650

    Connecting the Treo 650 to the ELBT595 was a snap.

    Make the ELBT595 base discoverable by:
    • System Setup -> Bluetooth -> Select Mobile -> Empty -> Find Me

    On the Treo:
    • go to the Bluetooth application
    • select Setup Devices
    • then select “Hands-free Setup”
    • Find the base and connect with the PIN displayed on the base
    • Then when the pairing is complete, the Treo will ask if you’re connecting to a “Headset” or a “Car Kit” – Select “Car Kit” and then “Done”
    If your Treo doesn’t ask you if you’re connecting to Headset or Car Kit, then you’re probably using an older firmware on your Treo. Please upgrade your Treo and try again.

    Treating the ELBT595 as a Car Kit makes the whole set up work correctly.

    However, Car Kits keep an open Bluetooth connection with the Treo. This will drain your battery more rapidly. Consider keeping your Treo in a charger near your ELBT595 base. Also, this means that your Treo’s Bluetooth connection is incessantly occupied – as long as the Treo is in range of the ELBT595, you can’t send files to the Treo via Bluetooth from any other devices nor can you connect your Bluetooth headset to the Treo directly.

    10
    Oct

    ELBT595 Base Reset

    So you’ve got your fancy Uniden ELBT595 cordless phone, and new handsets aren’t registering with the base anymore, or maybe you’ve just got all sorts of messed up settings and just want to reset everything and start over. It’s not documented anywhere else, so here’s how to do it:
    • Unplug the AC adapter from the back of the base
    • Remove the backup battery from the base
    • Press and hold both the do-not-disturb (dnd) key and the delete (ø) key.
    • Keep holding them down while you plug in the AC adapter again.
    • Wait until you hear a long beep.
    • You can release the keys now.
    • Unplug the base, replace the backup battery, and plug the base in again.

    Now you’ve got a fully cleared base.

    You can press and hold ‘end’ and ‘#’ on the handset, then select “Replacing Base” then drop the handset back in the base to reregister it as the #1 handset.

    I had to do this because the handset that shipped with mine wasn’t properly registered to the base. When I finally succeeded at registering the handset with the base it was shown as #2. I hoped that by registering the handset repeatedly, I’d reach #10, then loop back around to #1. No luck. It just stopped accepting handset registrations when I reached #10. Clearing the base’s memory is the only way to get back to #1.

    Now, if someone could point me to the method for wiping the memory of a handset…

    3
    Aug

    Automator and FileVault

    Update: Jan tells us that in Leopard this issue is fixed. I have not tested it myself, but I certainly trust her.

    Truth be told, I’m an AppleScript junkie. I love how easily I can write a simple program to give me a better or more natural interaction than it was designed for. As a result, I’m also a huge fan of Automator, which builds on AppleScript and makes development even easier (It reminds me of programming SCEA’s Carnage Heart).
    Anyway, trying it out I discovered that Apple ran into an AppleScript bug that’s been around since Panther, and I can’t believe hasn’t been fixed.

    The bug manifests itself as an “Applescript Error” such as :
    – “Can’t get properties of alias”
    – “Can’t get file type of alias”
    and is followed by (-1728).

    What’s going on here is that the AppleScript hooks in the Finder can’t cope with FileVault. I tried programming an Automator Action based on Jan Bardi‘s AppleScript, but the resulting alias still causes these errors.

    The only workarounds are to move files into a working directory and then move them back, or to turn FileVault off. I did the former.

    To do this in a workflow:
    1. Create a folder somewhere outside of FileVault (I created a “Scratch” folder on my startup disk)
    2. Use either the “Copy Finder Items” or “Move Finder Items” Finder Action near the start of your workflow and set the folder in step 1. as the destination.
    3. At the end of your workflow, use the “Move Finder Items” Finder Action and you can set your destination back in a FileVault folder.
    You probably want to check the “Replacing existing files” checkbox in both of these Finder Actions.

    Now your workflow can cope with FileVault, though not securely. A malicious program might monitor such working folders and copy their contents elsewhere, but if it’s going to a be a workflow running on a private machine, it’s most likely safe.

    23
    Jul

    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.

    11
    Jul

    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 com.apple.driver.AppleADBKeyboard
    

    If you see a line that looks something like this:

    57    0 0x2e3e8000 0x4000     0x3000     com.apple.driver.AppleADBKeyboard (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.