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


Click here to return to the 'Set Exposé's keyboard shortcuts to any keys' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set Exposé's keyboard shortcuts to any keys
Authored by: rpost77 on Aug 01, '05 05:36:04AM

Just sent this in as a Hint (not posted yet as the Hints have to be reviewed first - so I thought I'd reply so you know):-

How to remap Exposé keys to F14, F15 & F16 on an Apple Pro USB Keyboard.

----------------------------------------------------------------------------

This procedure was conducted 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 2 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 keys you want to use to the particular function.

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 the Apple website (http://developer.apple.com/).

Alternatively you can use PrefEdit - a free Preferences editor from Marcel Bresink Software-Systeme at http://www.bresink.de/osx/PrefEdit.html - this is a smaller download that having to download all of Xcode Tools to get the Apple version.

2) You need to have a version of the com.apple.symbolichotkeys.plist file on your system.

This file is located in ~/Library/Preferences/com.apple.symbolichotkeys.plist (where the ~ refers to the symbolic for the path for the current user (i.e. on my machine it's Users/xxxxx - so therefor the full path is Users/xxxxx/Library/Preferences/com.apple.symbolichotkeys.plist). If you have never altered the default hotkey settings or keyboard shortcuts (for Exposé, Dashboard or any other preset) then this file won't exist. As soon as you use the System Preferences for Exposé or Keyboard (Keyboard Shortcuts) then this file will be created (with only the entries for the shortcuts/hotkeys you changed that override the default settings).

I found that the easiest way to execute the changes was to access the Exposé System Preferences item and change all of them to something else (i.e. All Windows (F1), Application Windows (F2), Desktop (F3) and Dashboard (F4)). This results in the ~/Library/Preferences/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 ~/Library/Preferences/com.apple.symbolichotkeys.plist file for each one (or copy the one to each users path).

Also, (for those who don't know), an undocumented feature of the Exposé and Dashboard functions is that, if you hold down the Shift key while hitting the Exposé or Dashboard hotkeys, they perform the same functions but do it sloooowly (try it - its pretty groovy).

When you change the hotkeys to create the plist file as I mentioned above, 2 entries are created for each function - one for the hotkey itself and one for the modifier key function (in this case Shift). So you will also need to alter the modifier key entries to match the hotkey you decide to use for each function (if, that is, you want to - I would suggest you do so otherwise the modifier key definition will be left set to the 'old' key setting and I'm not sure what the consequences (if any) 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:-

0 = no modifier
131072 = Shift
262144 = Control
524288 = Option
1048576 = Command (Apple)

(I believe if you want the modifier key to be, say, Shift + Control, then just add the 2 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 (obviously you will lose any changes you made to the default settings for any keyboard shortcuts)).

2) Fire up the Property List Editor (if you installed Xcode Tools its in /Developer/Applications/Utilities/Property List Editor.app).

3) On the Menu Bar click File - Open and navigate to the ~/Library/Preferences/com.apple.symbolichotkeys.plist file, select it and click Open.

4) In the resulting window, expand (click on) the triangle (twistie) next to Root then the twistie next to AppleSymbolicHotKeys.

5) You will see a bunch of numbered entries with their own twisties. For each one you want to change, you need to click on (the twistie):-
1) The number (i.e. 32) then
2) value then
3) parameters

6) For each parameters entry there are 3 numbered entries (0, 1 & 2).

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 overtyping with the new key value. In the entries for the modifier keys, 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'.

7) The relevant Exposé and Dashboard Shortcut (hotkey) numbers are:-

All Windows = 32
All Windows Modifier = 34

Application Windows = 33
Application Windows Modifier = 35

Desktop = 36
Desktop Modifier = 37

Dashboard = 62
Dashboard Modifier = 63

8) The relevant values for the F13, F14, F15 & F16 keys are:-

F13 = 105
F14 = 107
F15 = 113
F16 = 106

9) When you have changed the key value(s) for the Exposé or Dashboard function(s) you want to change, on the Menu Bar click File - Save.

10) Log off and logon (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:-

F13 = Dashboard
F14 = Desktop
F15 = Application Windows
F16 = All Windows

Note:- when you go to the Keyboard Shortcuts System Preferences pane and scroll down to the Dock, Exposé, and Dashboard entries, for those
functions where you have set F14, F15 or F16 as the shortcut key(s), in the Shortcut column there will be a blank space where it usually lists the key(s) that is set. Don't worry - it's not set to nothing, it just cannot display the key (because it doesn't 'know' 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 - 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:-

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 (there are lots of these types of things for PCs but I could not find a single one for the Mac - and the PC ones running under VirtualPC aren't helpful because the scan codes for those keys never make it to Windows (VirtualPC) to be scanned).


Regards,

Ralph Post



[ Reply to This | # ]