Sunday, April 10, 2016

Windows 10 and Virtual Desks

I'm happy that Microsoft finally added virtual desktops to windows.  They could have made the hotkeys customizable to make it more user friendly but then maybe I expect too much :}

Luckily there is my old friend AutoHotKey:  http://ahkscript.org/
install the program to allow launching any .ahk file or compiling it to an .exe file to run on computers that don't have AutoHotKey installed.

I made a simple script that does 3 things:

      1.  Provides a popup menu of applications and functions with the middle mouse button
      2.  Shows all the desktops when X2 (forward button on 5 button mouse) is pressed
      3.  Moves forward and backward through the desktops by holding X2 and using the mouse wheel


Heres the code, simply copy/paste to notepad and save as vdesk.ahk     It can be run by double clicking from explorer or compiled to a .exe by rightclicking the file and selecting the option.   Add to the start menu startup folder for loading at windows login. 

Menu, MyMenu, Add, Firefox
Menu, MyMenu, Add, Explorer
Menu, MyMenu, Add, CCleaner
Menu, MyMenu, Add 
Menu, MyMenu, Add, Desktop
Menu, MyMenu, Add, Programs
Menu, MyMenu, Add 
Menu, MyMenu, Add, Logoff
Menu, MyMenu, Add, Shutdown
return

Explorer:
Run, explorer.exe
Return

Firefox:
Run, C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Return

CCleaner:
Run, C:\Program Files\CCleaner\ccleaner64.exe
Return

Desktop:
Run, C:\Users\Public\Desktop
Return

Programs:
Run, C:\Users\kcair\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Return

Logoff:
Shutdown, 0
Return

Shutdown:
Shutdown, 1
Return

Mbutton::Menu, MyMenu, Show

XButton2 & Wheelup::Send, ^#{Left}
XButton2 & Wheeldown::Send, ^#{Right}
XButton2::Send, #{Tab}