Eric F. Savage

Good stuff, updated weekly(ish)

Enabling Buttons on Apple Keyboard in Windows

apple-keyboard

I recently picked up, and am liking, the new “wafer thin” aluminum keyboard from Apple. Its very small, I like the key action and it’s very solid considering it’s size and thickness. But, I use it on Windows, and there’s no driver available other than the standard keyboard one, so the extra keys like media controls aren’t enabled. I came across a freeware macro program called AutoHotKey that works very nicely, and wrote up a few little scripts for it. You can download AutoHotKey and run the scripts yourself, or you can download the compiled version here [enable_mac_aluminum.zip, 193KB] and just pop it into your Startup folder.

Commands:
Shift-F3: Print Screen
Shift-F4: Task Manager
Shift-F7: Previous Track (in Winamp or Yahoo! Music Jukebox)
Shift-F8: Pause/Play (in Winamp or Yahoo! Music Jukebox)
Shift-F9: Next Track (in Winamp or Yahoo! Music Jukebox)
Shift-F10: Mute/Unmute
Shift-F11: Volume Down
Shift-F12: Volume Up
Windows-s: Open http://www.efsavage.com :)

Here’s the entire script:

#s::Run www.efsavage.com
+F3::Send {PrintScreen}
+F4::Send, {SHIFTDOWN}{CTRLDOWN}{ESC}{SHIFTUP}{CTRLUP}
+F7::
IfWinExist ahk_class Winamp v1.x
{
ControlSend, ahk_parent, z ; Pause/Unpause
return
}
IfWinExist ahk_class YMPFrame
{
SetTitleMatchMode 2
IfWinNotActive, Yahoo! Music Jukebox
WinActivate
WinWaitActive, Yahoo! Music Jukebox
MouseClick, left, 29, 107
Sleep, 100
MouseClick, left, 112, 76
WinMinimize
return
}
return
+F8::
IfWinExist ahk_class Winamp v1.x
{
ControlSend, ahk_parent, c ; Pause/Unpause
return
}
IfWinExist ahk_class YMPFrame
{
SetTitleMatchMode 2
IfWinNotActive, Yahoo! Music Jukebox
WinActivate
WinWaitActive, Yahoo! Music Jukebox
MouseClick, left, 29, 107
Sleep, 100
MouseClick, left, 30, 77
WinMinimize
return
}
return
+F9::
IfWinExist ahk_class Winamp v1.x
{
ControlSend, ahk_parent, b ; Pause/Unpause
return
}
IfWinExist ahk_class YMPFrame
{
SetTitleMatchMode 2
IfWinNotActive, Yahoo! Music Jukebox
WinActivate
WinWaitActive, Yahoo! Music Jukebox
MouseClick, left, 29, 107
Sleep, 100
MouseClick, left, 148, 79
WinMinimize
return
}
return
+F10::Send {Volume_Mute}
+F11::Send {Volume_Down 3}
+F12::Send {Volume_Up}

Update: Reader Svolte points us to SharpKeys, which (by default) maps F13 to print screen. The advantage of doing this is that alt-print-screen (capture just active window) works, while I was unable to replicate with the AutoHotKey script.

  • Pingback: Year One- by Eric F. Savage

  • uiop

    Thanks so much for this script. I’m not vey tech saavy, so may I ask what the startup folder is, and how I access it? Thank you.

  • http://zzaps.com zzap

    Ah, that was a great help. Found your site via Google when trying to find out a good app that will allow me to set up certain keyboard hotkeys on the Apple keyboard to do certain things. Thanks!

  • Andy

    Thanks alot

  • Andy

    Thanks alot

  • sanya

    you’re awesome thanks so much! you just made my life a whole lot easier :)

  • susan

    this is great. thanks. i picked up the keyboard today and was wondering how to do some tasks like print screen. any chance you will create more scripts?

  • Pingback: Making your Apple Keyboard work better with a Windows PC | Torley Lives

  • http://onetwentyone.org Adrian

    This is fantastically helpful. Much appreciated.

  • http://smallcomputing.net/ netbooks, etc.

    A friend one of mine just picked one of these keyboards up but doesn’t have a Mac. Assuming you have access to a Leopard disc (or the Boot Camp drivers), there’s an alternative way to make the media keys work, however, it doesn’t allow total customization (but does use the actual Apple software):

    http://smallcomputing.net/2008/09/16/how-to-apple-aluminum-keyboard-in-windows/

    Cheers.

  • Mike

    Word of warning for the Boot Camp method: The Boot Camp software kept trying to write to my BIOS to tell it which OS to boot into, thus erasing the BIOS on bootup. Very frustrating! Also, the keys were very haphazard – sometimes Eject showed the nice picture and did nothing, other times the volume keys didn’t respond at all.

    Autohotkey, for lack of Apple’s pretty OSD, is a more reliable solution.

    Also, F14 works as Print Screen without any remapping, in case you were wondering :)

  • Pingback: Apple's Awesome Short Stroke Aluminum Keyboard Review

  • http://www.isyougeekedup.com Eric

    Hey man, thanks a lot for the compiled .exe. I was freakin looking everywhere for this and the Boot Camp drivers refused to play with Windows. I left you a link on my blog in my Apple Aluminum Keyboard Review post.

    – Eric

  • Svolte

    You can also use SharpKeys to change the function of buttons, for example to make the F13 print screen, I can really recommend it :)

  • http://www.alivecrew.dk shamran

    hey Erik

    I have tried your macro and the shift+F4 works well, but I have a hard time getting the mute, volume up/down to work. It seems a bit flaky at best.

  • http://www.alivecrew.dk shamran

    hmmm okey .. just did some testing!

    This is a bit strange. To get mute and volumecontrol to work I have to press shfit+F[5-8]+F10 for mute and so on.

    What gives ?!?!

  • http://googledit Barry

    I too have found the apple keyboard fantastic to use, (On Win XP) and have downloaded the ‘compiled version’…..now, just how do I extract the files to ”Startup”..mind you, have discovered whilst typing this that the @ icon is not above the number 2 as shown on the keyboard, but by pressing shift and the button that has ” and ‘ on it. (second button to left of the enter key..) Do I extract and drag & drop it to the folder. I assume you are talking about the Startup folder in the main ”all programs” list.

  • http://googledit Barry

    Sussed it, and even used your link (cmd-windows plus S) to return to this part of your site. Now, as I use iTunes, how do I convert the winamp/yahoo keys to iTunes?. Mind you, I never used the keyboard I had before to operate such programmes so it is not that important. What was, is that I can now use print-screen. Many thanks to your download. Now I’m thinking of the apple wireless keyboard……….

  • Pingback: Apple’s Awesome Short Stroke Aluminum Keyboard Review - Let’s Pk

  • Jeff

    if using this on a laptop, will this effect my laptop built-in keys while having the apple keypad attached (or when not attached)

  • April

    Thanks so much! Very much appreciated.

  • andrew

    hi there, thanks for this! is there anyway to get the equals key on the right number keypad to work? And the brightness funtion?

  • concrete_d

    Thanks, this is just what I’m looking for – no more plugging in my Dell keyboard just to get a screen capture.

  • LainyC

    THANK YOU!!!! I just surfed a bunch of garbage that was not helpful. Yours is the first I’ve found to fix this.

  • Rino

    Great stuff – thank you! Running well with XP. Any experience with Windows 7?

  • Erwin

    Brilliant mate, this works a treat, even under Windows 7 Ultimate, thanks so much!!!!

  • Leo

    Hello! Maybe you can help me with a similar problem. I have a Macbook with an UK keyboard layout. The Bootcamp installs all required drivers for Windows XP with the correct layout.

    The trouble is that my input language is Portuguese. And the UK layout that came with Windows don’t allow me to input the latine characters properly (e.g. ê, í). The only layout that allow me to make this is the US International, but, in this case, lots of keys switches its symbols (obviously).

    So, my question is, can you make this script of yours input the latine characters?

    Thank you!

  • http://www.joshcoast.com Josh

    Nice, now if only someone can get the mighty mouse to function 100% on the PC… as well as the many many other features that come standard on a mac OS, that you have to try and search for and install garbage to try and mimic the functionality. If only the company I work at would come to the light side. Use the force.

  • Ash

    Is there a way to get backspace (or is it delete) to work with this?

  • Dave R.

    What a great little find! I have a Mac and a PC and share the keyboard between them. This script is brilliant! Thanks so much.

  • http://www.totallythebomb.com Jamie Harrington

    Seriously, you’re a total badass for this. I am freakin’ in love with the mac keyboard, but was really missing my volume keys! Thank you so much!!! Worked like a charm on Windows 7!

  • Jim

    How about F1 F2?
    will these two func keys also work with this script?

  • Flavio

    Cheers for this Eric. Handy scripts!

  • http://lenjeriefemei.net/ lenjerie intima

    Thanks allot, this is just what I’m looking for – no more plugging in my old hp keyboard just to get a screen capture.

  • mike

    Is there anyway to customize this?

  • Anjan

    sweet. works awesome.

  • Michael

    Thanks for this, been looking for something to do this for 4 years

  • Adrian Fedoreanu

    F13::PrintScreen

  • http://cbutterworth.com/ Chris Butterworth

    Thanks. This worked great.

  • dental implants

    Great info! Thanks!

    Windows MAC Support

  • jingles

    great script, thanks!

    How would i alter the code so that the “fn” button (left of “home” on wired apple keyboard) is used instead of the shift?

    ie: fn+F9 would equal next track

    I use software programs that require shift+F# keys.

    maybe email me at jingleby [at] gmail [dot] com if you’re able to help :)

Entries (RSS) and Comments (RSS).