Thursday, May 13, 2010

Mac-style wheel zoom, Exposé/Switcher on Windows 7

Having a Mac at work has been a mixed blessing, mostly good. There are some great OS features that I've become addicted to. Happily, I have discovered ways to duplicate them on my Windows 7 home machine, and with better customizability even.

Wheel zoom

On Mac OS, holding command and using the mouse wheel zooms you in and out of your screen view. This is on the operating system level, so it works in any application. Windows 7 has a similar (i.e. copied) feature where holding the windows key and pushing plus/minus zooms. Obviously it's nicer to use the mouse wheel. Luckily, with AutoHotKey it's easy to set this up on Windows and even make it better.

After installing AutoHotKey, run the following script:

; Only one instance running at a time
#SingleInstance force


; Mac-like zooming
~LCtrl & WheelUp::
  sendinput #{NumpadAdd}
return

~LCtrl & WheelDown::
  sendinput #-
return

~LWin & WheelUp::
  sendinput #{NumpadAdd}
return

~LWin & WheelDown::
  sendinput #-
return 

I derived this from AeroZoom by wandersick, which is an excellent set of shortcuts for presentations. I pulled out just the very simple zooming functionality and made it duplicate the Mac functionality more. Thanks to wandersick for putting his tool out with the source!

My mouse has side buttons that I usually use just for forward/back. I added the following so that now I can do the wheel zoom without the keyboard at all, just by holding the left side button and wheeling:

; Additional mouse-only zooming
~XButton1 & WheelUp::
  sendinput #{NumpadAdd}
return

~XButton1 & WheelDown::
  sendinput #-
return 

Exposé/Switcher

Exposé is the Mac OS feature that makes it easy to find windows when you have a thousand different things open at once. There is a very similar application for Windows called Switcher. I like having Mac OS setup so that when you push the middle button (the wheel) it calls up Exposé. With AutoHotKey, of course, it was simple to set up identical functionality on Windows 7 via Switcher.

On my home mouse, I find it easier to push both side buttons simultaneously than to push the wheel down, so I set it up that way. I also had trouble getting this to work with Switcher's default activation button (windows-`), so I added an additional Switcher hotkey (Switcher is very nicely customizable too) and then just setup AutoHotKey to trigger that:

; Mac-like expose, hooking into switcher
~XButton1 & XButton2::
  send #s
return

Hope that helps some other people suffering from Mac lust. Enjoy!

4 comments:

  1. Great tip its always fun when my Windows 7 pc is just a lil bit more mac =P

    ReplyDelete
  2. Thanks! long google search but here's what i've been looking for

    ReplyDelete
  3. Perfect works just like a Mac ! beats all the other zoom utilities, just put it in the Startup folder. THANKS !!!!

    ReplyDelete