Jump to content
Sign in to follow this  
Shepherdboy

How can I map a Function Key?

Recommended Posts

Greetings,

 

I am a switcher of a little over a year. I love my mac (2 now, in fact).

 

I would like to map one of the function keys to a keyboard shortcut. That may sound strange, but I do have a reason. I like to hide windows for apps that I keep running in the background all day (ie. Entourage). I find it really awkward to press the CMD-H key combination to hide the current window. I would like to map a function key (F2, for example) to execute CMD-H and hide the current window. I would even accept some other CMD combination that I find easier to press (perhaps CMD-`).

 

Any help would be appreciated.

 

Thanks,

 

Shepherdboy

Share this post


Link to post
Share on other sites

Easy one using my favourite app ever, quicksilver. We're going to make a hot key. So, you've got quicksilver installed, and got it's preferences window open. Go to the Triggers pane and click on the + icon to make a new trigger. Double click on the newly created trigger and hit the . key to enter text entry mode. Paste the following code in, press tab and type as much of Run as applescript as you need to. Then click on the i to get drawer out and choose whatever hotkey you want (function keys can be assigned if you want to).

tell application "System Events"
keystroke "h" using {command down}
end tell

 

triggers-20070725-172804.jpgqucs-20070725-172414.jpgqucs-20070725-172612.jpg

 

Enjoy!

Edited by Graham

Share this post


Link to post
Share on other sites

Thanks, I've been using Quicksilver for a long time, but I confess that I've only used it to launch applications. I had no idea you could set system wide shortcuts with it.

 

This solution works, but I have to press whatever key combination I set twice. I've tried it with several (F2, CMD-`, CMD-F1) and with all I have to press the combination twice to get the current window to hide. Is there something I've done wrong?

 

Shepherdboy

Share this post


Link to post
Share on other sites

Make sure the settings for activation are the same as are in the screenshot.

Share this post


Link to post
Share on other sites

Yes, they are. I still have to hit the Function key twice to get the hide.

 

Shepherdboy

 

Make sure the settings for activation are the same as are in the screenshot.

Share this post


Link to post
Share on other sites

Make another trigger to start an app or something. Does this happen for only that specific trigger or all of them? I'm a bit lost to be honest, I've never heard of anything like this happening.

Share this post


Link to post
Share on other sites

I created a trigger to start an app on function key press and it works fine with 1 press. I deleted the Hide trigger and recreated it, but it still requires two presses. Odd...

 

Shepherdboy

 

Make another trigger to start an app or something. Does this happen for only that specific trigger or all of them? I'm a bit lost to be honest, I've never heard of anything like this happening.
Edited by Shepherdboy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×