How to map F14, F15, and F16 to Exposé, Dashboard, etc.

Aug 11, '05 09:22:00AM

Contributed by: rpost77

This hint explains how to use the F14, F15, and F16 function keys for your own uses -- Dashboard, Exposé, etc. This procedure was tested with an Apple Pro USB keyboard connected to a PowerMac G4 MirroredDriveDoors (MDD) FW800 Dual 1.25Ghz PowerPC Mac with OS X 10.4 (Tiger). It may or may not work with other keyboards (for example PowerBooks, etc.), or with previous versions of OS X. I successfully used this method on two Apple Pro USB keyboards -- the one with 15 F-keys (original Pro keyboard) and the latest one with 16 F-keys. Essentially, you need to edit the keyboard shortcuts plist file and manually define the function keys you want to use for a particular action.

There are a couple of things you need before you can execute this process:

  1. You need a copy of the Property List Editor application, which is included in the Xcode Tools install (Xcode Tools can be downloaded from the Apple Developer Connection section of Apple's website. Alternatively, you can use PrefEdit, a free preferences editor from Marcel Bresink. This is a smaller download that having to download all of Xcode Tools to get the Apple version. [robg adds: You could also use PlistEdit Pro, a $24.95 shareware package.]

  2. You need to have a version of the com.apple.symbolichotkeys.plist file on your system. This file is located in your user's Library -> Preferences folder. If you have never altered the default hotkey settings or keyboard shortcuts (for Exposé, Dashboard, or any other preset via the Keyboard Shortcuts section of the Keyboard & Mouse preferences panel), then this file won't exist. As soon as you use the System Preferences for Dashboard/Exposé or Keyboard Shortcuts to make a change, then this file will be created (with only the entries being those of the shortcuts/hotkeys you changed which override the default settings).
Read on for the step-by-step...

I found that the easiest way to execute the changes was to access the Exposé System Preferences item and change all of the shortcuts to something else -- for example, set All Windows to F1, Application Windows to F2, Desktop to F3, and Dashboard to F4. This results in the com.apple.symbolichotkeys.plist file being created with the appropriate entries already existing (so you can just change the relevant values without having to add the whole lot!).

Note also that, if you have more than one user defined and you want the changes to apply to all those users, you will have to create and edit the com.apple.symbolichotkeys.plist file for each one (or copy the modified file to each user's Library/Preferences folder).

When you change the hotkeys to create the plist file as I mentioned above, two entries are created for each function -- one for the hotkey itself and one for the modifier key function (in this case Shift, which makes the animation go in slow motion). So you will also need to alter the modifier key entries to match the hotkey you decide to use for each function. I would suggest you do so even if you don't use slow motion mode, otherwise the modifier key definition will be left set to the 'old' key setting and I'm not sure what the consequences of this may be. You presumably could also change the modifer value to one of the other modifier keys (Control, Option or Command (Apple)). I haven't tried this, but here are the relevant modifer keys and their values if you want to try:

I believe if you want the modifier key to be, say, Shift-Control, then just add the two numbers together to have this combination as the modifier - i.e. Shift (131072) + Control (262144) = 393216.

The process:
  1. Make a backup of the ~/Library -> Preferences -> com.apple.symbolichotkeys.plist file, in case something goes wrong! Although if you just delete the file, then everything goes back to the default settings, but you'll obviously lose any changes you made to the default settings for any keyboard shortcuts.

  2. Fire up the Property List Editor (in /Developer -> Applications -> Utilities), or the editor you've chosen to use.

  3. Choose File: Open, and navigate to the com.apple.symbolichotkeys.plist file, select it, and click Open. In the resulting window, expand the triangle (twistie) next to Root then the triangle next to AppleSymbolicHotKeys.

  4. You will see a bunch of numbered entries, each with their own triangles. For each one you want to change, you need to click on the triangle to expand it:
    1. The number itself (i.e. 32) then...
    2. Value then...
    3. Parameters

  5. For each Parameter entry, there are three numbered entries (0, 1, 2), as seen in this screenshot. The entry you want to change for the key that is pressed to initiate the function is the entry numbered 1. You change the value by double-clicking the entry in the Value column and typing in a new key value. If you want to also change the modifier value as well as the key value, then the entry for the modifier value is the entry numbered 2 (in the modifier key number, not the activation key number section!).

  6. The relevant Exposé and Dashboard Shortcut (hotkey) numbers are:
  7. The relevant values for the F13, F14, F15, and F16 keys are:
  8. When you have changed the key value(s) for the Exposé or Dashboard function(s) you want to change, choose File: Save.

  9. Log out and login again (or restart) and test it out (I found that sometimes the changes were immediate without logging off, but sometimes they did not 'take' until a log off/restart).
I set my keys up as follows: Note: After making these changes, when you go to the Keyboard Shortcuts System Preferences pane and scroll down to the Dock, Exposé, and Dashboard entries, the value shown in the Shortcut column will be a blank. Don't worry -- it's not set to nothing, it just cannot display the key (because it doesn't know about those keys). Also, when you go to the Dashboard and Exposé System Preferences Pane, if you have set F14, F15 or F16 for any of those functions, the key shown in the listbox will display as F1. Once again, don't worry; it's not actually set to F1, but it seems this Preferences pane partially 'knows' the keys.

Presumably you could also assign other functions apart from Exposé or Dashboard to the F14, F15 or F16 keys using this method. The easiest way to figure out which entry in the plist file is associated to the function you want to assign F14, F15 or F16 to would be to do this:
  1. Open the plist file with the Property List Editor and note the numbers that currently exist.
  2. Go to System preferences and select Keyboard Shortcuts and change the function you want to change to something other than its default.
  3. Open the plist file again with the Property List Editor and there should be a new numbered entry for the function you just changed via Keyboard Shortcuts.
  4. Change the value for the key pressed to the value for F14, F15 or F16 using the method described above.
It may also be possible to remap functions to the other non-standard keys on the keyboard (such as the Volume Up/Down, Mute and Eject keys) but I do not know (nor could find anywhere) what the value of these keys are. If anyone has or knows where I can find a utility for displaying the key values of a Mac keyboard when the keys are pressed, then I would be very appreciative and I will test it out...

[robg adds: I haven't tested this one ... on my machine, F13 is available as a choosable key in the lists, but F14 through F16 are not.]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050801052917667