AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FastEight - single-stroke app switcher/launcher

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
ezuk



Joined: 04 Jun 2005
Posts: 146

PostPosted: Wed Nov 19, 2008 8:20 am    Post subject: FastEight - single-stroke app switcher/launcher Reply with quote

Yesterday, keyboardfreak made a comment which got me thinking.

He said that most of us use only a limited set of applications in our computing experience, and that most task switchers are overhead. You only need a complicated switcher if you use 10-20 apps and need to filter the list by keystrokes, etc.

keyboardfreak's solution was to dedicate his numpad to switching and launching common applications.

Personally, I need my numpad, and it's also a bit far away for me. So I came up with a somewhat different idea:



Each of the "buttons" in the image above corresponds to a single key on the keyboard. The top four buttons are asdf, and the bottom four are zxcv. Each button is linked with a specific application (Firefox, Word, etc). If this app is running, the button switches to it. If it is not running, the button runs it.

I activate the script using two quick taps of the shift key (I use CtrlMorse for this -- the two taps actually send ctrl+shift+f2, which activates this script).

So - to run MS Word, it's shift-shift-z. And for Firefox, it's shift-shift-d. And the keys never change, so with time they can be memorized and you don't need to look for the button in the image.

It's a fast, easy way to switch between your common apps. Thanks to keyboardfreak for the inspiration.

The icons used are Carbon Gloss by ~skm-industries.



Code:

; (c) ezuk 2008

App1Name = Help & Manual
App1Icon = carbon_dw.png
App1Path = c:\Program Files\HelpandManual4\HelpMan.exe

App2Name = Google Chrome
App2Icon = carbon_cm.png
App2Path = C:\Users\ezuk\AppData\Local\Google\Chrome\Application\chrome.exe

App3Name = Mozilla Firefox
App3Icon = carbon_ff.png
App3Path = c:\Program Files\Mozilla Firefox\firefox.exe

App4Name = Total Commander
App4Icon = carbon_fl.png
App4Path = c:\Program Files\totalcmd\TOTALCMD.EXE

App5Name = Microsoft Word
App5Icon = carbon_doc.png
App5Path = c:\Program Files\Microsoft Office\Office12\WINWORD.EXE

App6Name = Email
App6Icon = carbon_eml.png
App6Path = C:\Users\ezuk\AppData\Local\Google\Chrome\Application\chrome.exe http://www.gmail.com

App7Name = PSPad
App7Icon = carbon_txt.png
App7Path = c:\Program Files\pspad\PSPad.exe

App8Name = Help
App8Icon = carbon_dl.png
App8Path =

SetTitleMatchMode,2


    If (App1Name <>"") {
      Gui, Add, Picture,x0 gLaunchOrSwitch1, icons\%App1Icon%
    } Else{
      Gui, Add, Picture,x0, icons\blank.png
    }
    If (App2Name <>"") {
      Gui, Add, Picture,ys, icons\%App2Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
     
    If (App3Name <>"") {
      Gui, Add, Picture,ys, icons\%App3Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
   
    If (App4Name <>"") {
      Gui, Add, Picture,ys, icons\%App4Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
   
    If (App5Name <>"") {
      Gui, Add, Picture,x0 section, icons\%App5Icon%
    } Else{
      Gui, Add, Picture,x0 section, icons\blank.png
    }
   
    If (App6Name <>"") {
      Gui, Add, Picture,ys, icons\%App6Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
   
    If (App7Name <>"") {
      Gui, Add, Picture,ys, icons\%App7Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
   
    If (App8Name <>"") {
      Gui, Add, Picture,ys, icons\%App8Icon%
    } Else{
      Gui, Add, Picture,ys, icons\blank.png
    }
 
  ;CustomColor = FF00FF
  Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
  Gui, Color, 000000
  ;WinSet, TransColor, %CustomColor%
  Gui,show,center
  WinGet, fasteight, PID, A
  GroupAdd,FastEight, ahk_pid %fasteight%

  ^+F2::Gui,show
  #IfWinActive, ahk_group FastEight
    a::LaunchOrSwitch(1)
    s::LaunchOrSwitch(2)
    d::LaunchOrSwitch(3)
    f::LaunchOrSwitch(4)
    z::LaunchOrSwitch(5)
    x::LaunchOrSwitch(6)
    c::LaunchOrSwitch(7)
    v::LaunchOrSwitch(8)
    esc::Gui,hide
  #IfWinActive


return



LaunchOrSwitch(AppNumber)
{
    AppName := App%AppNumber%Name
    AppPath := App%AppNumber%Path
    IfWinExist,%AppName%
    {
      WinActivate
    } Else {
    Run,%AppPath%
    }
    Gui,hide
    return
}


; These labels are only needed so that a user could click the icon to run a program.
LaunchOrSwitch1:
  LaunchOrSwitch(1)
return
LaunchOrSwitch2:
  LaunchOrSwitch(2)
return
LaunchOrSwitch3:
  LaunchOrSwitch(4)
return
LaunchOrSwitch5:
  LaunchOrSwitch(5)
return
LaunchOrSwitch6:
  LaunchOrSwitch(6)
return
LaunchOrSwitch7:
  LaunchOrSwitch(7)
return
LaunchOrSwitch8:
  LaunchOrSwitch(8)
return


GuiClose:
ExitApp

Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Wed Nov 19, 2008 11:48 am    Post subject: Re: FastEight - single-stroke app switcher/launcher Reply with quote

ezuk wrote:
Personally, I need my numpad, and it's also a bit far away for me.


You can still use the numpad for entering numbers, since there is NumLock. Smile It's very addicitve to be able to switch to any application with a single keypress. It's extremely convenient in the long run.


Regarding your solution:

Haven't you tried eliminating SHIFT altogether?

Instead of pressing shift-shift-z how about pressing z twice quickly? It's not common to type zz, so it can be used as a double-press hotkey. Likewise xx, yy, ww, zz, etc.

The fewer keys one has to press for frequent operations the better.
Back to top
View user's profile Send private message
JoeSchmoe as guest
Guest





PostPosted: Wed Nov 19, 2008 2:35 pm    Post subject: fkee3 Reply with quote

Or just use FKee3:
http://www.autohotkey.com/forum/topic10068.html
Back to top
ezuk



Joined: 04 Jun 2005
Posts: 146

PostPosted: Wed Nov 19, 2008 3:02 pm    Post subject: Re: FastEight - single-stroke app switcher/launcher Reply with quote

keyboardfreak wrote:
ezuk wrote:
Personally, I need my numpad, and it's also a bit far away for me.


Instead of pressing shift-shift-z how about pressing z twice quickly? It's not common to type zz, so it can be used as a double-press hotkey. Likewise xx, yy, ww, zz, etc.



I like the way you think!

I recall there used to be a script for working with double-strokes of normal keys (as opposed to my Morse script, which works with modifier double-strokes). Do you know the script?

I'll dig around the forums, try to find it myself.
Back to top
View user's profile Send private message
ezuk



Joined: 04 Jun 2005
Posts: 146

PostPosted: Wed Nov 19, 2008 3:03 pm    Post subject: Re: fkee3 Reply with quote

JoeSchmoe as guest wrote:
Or just use FKee3:
http://www.autohotkey.com/forum/topic10068.html


And reach all the way to the F keys?

Or am I missing something?
Back to top
View user's profile Send private message
keyboardfreak



Joined: 09 Oct 2004
Posts: 216
Location: Budapest, Hungary

PostPosted: Wed Nov 19, 2008 3:10 pm    Post subject: Re: FastEight - single-stroke app switcher/launcher Reply with quote

ezuk wrote:
I recall there used to be a script for working with double-strokes of normal keys (as opposed to my Morse script, which works with modifier double-strokes). Do you know the script?


Nope, but I have one more thing to add:

Even common double letter combinations can be used if an additional check is added which ensures no other letter was typed before the double-press.

For example, ss is used in the word assassination, but there is no word which begins with ss, so if you check that within a short time (say, 0.5 seconds) no other letter was typed before the ss then it can safely be interpreted as a hotkey.
Back to top
View user's profile Send private message
ezuk



Joined: 04 Jun 2005
Posts: 146

PostPosted: Wed Nov 19, 2008 3:14 pm    Post subject: Re: FastEight - single-stroke app switcher/launcher Reply with quote

keyboardfreak wrote:
ezuk wrote:
I recall there used to be a script for working with double-strokes of normal keys (as opposed to my Morse script, which works with modifier double-strokes). Do you know the script?


Nope, but I have one more thing to add:

Even common double letter combinations can be used if an additional check is added which ensures no other letter was typed before the double-press.

For example, ss is used in the word assassination, but there is no word which begins with ss, so if you check that within a short time (say, 0.5 seconds) no other letter was typed before the ss then it can safely be interpreted as a hotkey.


Yes... I see what you're saying. But making something like that is a bit above my AHK abilities, I'm afraid.
Back to top
View user's profile Send private message
Chicken Pie 4 Tea



Joined: 18 Aug 2009
Posts: 375
Location: holland

PostPosted: Fri Sep 24, 2010 1:27 pm    Post subject: Reply with quote

Thanks, and I love the way it DOESNT use the numpad cos a lot of us laptop users don't have a numpad, OK!
_________________
"Choose your parents wisely"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group