Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my MacBook I have use all F1 F2 etc. keys as standard function keys option unchecked. I use FunctionFlip to map F3 from Expose to Spaces.

However I would like to use function keys as real function keys when working under virtualised environment like VirtualBox or VMware Fusion. Going to System > Preferences is not very convenient.

Do you now how to check use all F1 F2 etc. keys as standard function keys only when a specific application is active?

share|improve this question

Try combining FunctionFlip with BetterTouchTool:

  • Set the keys you want "flipped" with FunctionFlip
  • Set up application specific keys with BetterTouchTool
share|improve this answer
This is a fantastic app combination! – Lantrix Jun 20 '14 at 0:20

Grab IronAHK and use it to remap ALL keys instead of System Preferences (reason being is that it might conflict with system -> preferences), it comes with a makefile for compiling easily under Mono.

Then use it just like AutoHotkey:

F1::Send { F1 }
share|improve this answer
I cannot find any compiled version. Do I need to compile on my own ? – Michal Sznajder Oct 2 '09 at 19:46
Currently they do not provide any, yes you will need to compile your own unfortunately. But they provide a makefile I believe. – John T Oct 3 '09 at 3:34
up vote 1 down vote accepted

I finally started to use Palua and it is just great.

share|improve this answer

One alternative to Palua is KeyRemap4MacBook:

<?xml version="1.0"?>
        <autogen>__KeyToKey__ KeyCode::BRIGHTNESS_DOWN, KeyCode::F1</autogen>
        <autogen>__KeyToKey__ KeyCode::BRIGHTNESS_UP, KeyCode::F2</autogen>
        <autogen>__KeyToKey__ KeyCode::EXPOSE_ALL, KeyCode::F3</autogen>
        <autogen>__KeyToKey__ KeyCode::LAUNCHPAD, KeyCode::F4</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::KEYBOARDLIGHT_LOW, KeyCode::F5</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::KEYBOARDLIGHT_HIGH, KeyCode::F6</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::MUSIC_PREV, KeyCode::F7</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::MUSIC_PLAY, KeyCode::F8</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::MUSIC_NEXT, KeyCode::F9</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::VOLUME_MUTE, KeyCode::F10</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::VOLUME_DOWN, KeyCode::F11</autogen>
        <autogen>__ConsumerToKey__ ConsumerKeyCode::VOLUME_UP, KeyCode::F12</autogen>
        <autogen>__KeyToKey__ KeyCode::F1, KeyCode::BRIGHTNESS_DOWN</autogen>
        <autogen>__KeyToKey__ KeyCode::F2, KeyCode::BRIGHTNESS_UP</autogen>
        <autogen>__KeyToKey__ KeyCode::F3, KeyCode::EXPOSE_ALL</autogen>
        <autogen>__KeyToKey__ KeyCode::F4, KeyCode::LAUNCHPAD</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F5, ConsumerKeyCode::KEYBOARDLIGHT_LOW</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F6, ConsumerKeyCode::KEYBOARDLIGHT_HIGH</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F7, ConsumerKeyCode::MUSIC_PREV</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F8, ConsumerKeyCode::MUSIC_PLAY</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F9, ConsumerKeyCode::MUSIC_NEXT</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F10, ConsumerKeyCode::VOLUME_MUTE</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F11, ConsumerKeyCode::VOLUME_DOWN</autogen>
        <autogen>__ConsumerToKey__ KeyCode::F12, ConsumerKeyCode::VOLUME_UP</autogen>

See the source for the key code values and predefined settings.

share|improve this answer

Unfortunately, this isn't an option that Apple or FunctionFlip provides.

However, the author of FunctionFlip has obviously been able to write code that allows for dynamic configuration of the function keys so it can be done.

I would contact the author of FunctionFlip, and ask if he could add the features you need. Namely, controlling function key behavior depending on the active application.

If you pledge to donate for the feature it might get implemented faster.

Otherwise, I don't know of any other programs that offer this functionality.

share|improve this answer

You could use AppleScript to toggle the state of the function keys:

tell application "System Preferences"
reveal anchor "keyboardTab" of pane ""
end tell
tell application "System Events" to tell process "System Preferences"
click checkbox 1 of tab group 1 of window 1
end tell
quit application "System Preferences"

In addition, you can make this app specific with the help of Keyboard Maestro. If written a small tutorial how to pull this of here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.