Skip to content

Archive for June, 2006

28
Jun

Tweaking the VoiceNotes Widget

I’ve tried various applications to help me get my thoughts down quickly into something more permanent, and recently I’ve tried WidgetMachine’s NotePad 2.0 and VoiceNotes. I really like NotePad 2.0, but couldn’t get VoiceNotes to record correctly. After fixing it, I like it just as much. The problem was that VoiceNotes could not record to its default location in my home folder since I have FileVault enabled. I tweaked the widget to remedy that and then modified it to minimize the likelihood that one recording would overwrite another. By default each new recording has the exact same name unless you title the recording. If I’m in a hurry to record what I’m thinking about, I don’t have time to name the recording first. So instructions to modify the widget are below. Note: the usual disclaimers apply – modify at your own risk. Also, make sure you register this excellent widget.

Download and Uncompress VoiceNotes.zip

– Control-Click (or right-click) the Widget that was uncompressed

– Select “Show Package Contents”

– Open “voicenotes.js” in your favorite text editor

– Modify line 2 to select where notes should be stored. If you’re using FileVault, make sure the folder is not in your FileVault-protected home folder.

– Comment out line 115 that reads:

edit_div.innerText = "New Note";

by putting two slashes in front:

// edit_div.innerText = "New Note";

– Then copy and paste the following code below that line:

// Define a mostly unique name for the recording.
// Since the naming does not take timezone or daylight savings time
// into account it is possible for there to be overlap of filenames
// which may result in one recording overwriting another. 
var right_now=new Date();

var name_year = right_now.getYear(); 
if (name_year < 2000) 
name_year = name_year + 1900; 

var name_month = right_now.getMonth() + 1;
if (name_month < 10)
name_month = "0"+ name_month;

var name_date = right_now.getDate();
if (name_date < 10)
name_date = "0" + name_date;

var name_hrs = right_now.getHours();
if (name_hrs < 10)
name_hrs = "0"+name_hrs;

var name_min = right_now.getMinutes();
if (name_min < 10)
name_min = "0"+name_min;

var name_sec = right_now.getSeconds();
if (name_sec < 10)
name_sec = "0"+name_sec;

var new_name = ""+name_year+name_month+name_date+name_hrs+name_min+name_sec;

edit_div.innerText = new_name;

- Save the file.

- Double-click the widget to install it.

- When you create a new recording, it will now place the recording where you like and it will title each new recording with the current date and time by default (e.g. 20060629071908)

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.