header

Torsten Curdt’s weblog

Exposé on Enter

Isn’t it sad that there a two keys on the keyboard that hardly ever (well, …never!) are getting used? When was the last time you wrote a mail all in captial letters? What the hell is caps lock for?!? …and more Powerbook specific: why the enter key?? I’ve never ever used it – up until now.

With some help of my local OSX guru I finally figured out a way to assign Exposé’s “all windows” to the enter key. You cannot assign it from the GUI but you can change the OSX default settings directly.

Basically you have to assign the symbolic hotkeys 32 and 34 to your the scan code of your enter key. The tricky thing is: the scan codes may vary for the different keyboards. So for my machine the scan code is 76 and my defaults look like this:


$ defaults read com.apple.symbolichotkeys
{
 AppleSymbolicHotKeys = {
 32 = {enabled = 1; value = {parameters = (-1, 76, 0); type = standard;};};
 33 = {enabled = 0; };
 34 = {enabled = 1; value = {parameters = (-1, 76, 131072); type = standard;};};
 35 = {enabled = 0; };
 36 = {enabled = 1; value = {parameters = ("-1", 111, 0); type = standard;};};
 37 = {enabled = 1; value = {parameters = ("-1", 111, 131072); type = standard;};};
 44 = {enabled = 0; };
 45 = {enabled = 0; };
 46 = {enabled = 0; };
 47 = {enabled = 0; };
 48 = {enabled = 0; };
 49 = {enabled = 0; };
 62 = {enabled = 1; value = {parameters = ("-1", 103, 0); type = standard;};};
 63 = {enabled = 1; value = {parameters = ("-1", 103, 131072); type = standard;};};
 };
}

This little tools comes in handy to find the correct scan code for your machine. Just change the file accordingly and write the settings back with “defaults write”.

Oh! …and if someone can come up with a good use for caps lock – please let me know ;)

Update:
The following seems to work better than using “defaults”:


plutil -convert xml1 -o keys.xml ~/Library/Preferences/com.apple.symbolichotkeys.plist
vi keys.xml
plutil -convert binary1 -o ~/Library/Preferences/com.apple.symbolichotkeys.plist \\
  keys.xml

    blog comments powered by Disqus