AutoHotkey Community

It is currently May 27th, 2012, 5:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: November 19th, 2008, 9:20 am 
Offline

Joined: June 4th, 2005, 1:54 am
Posts: 146
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:

Image

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



Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 19th, 2008, 12:48 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
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. :) 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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: fkee3
PostPosted: November 19th, 2008, 3:35 pm 
Or just use FKee3:
http://www.autohotkey.com/forum/topic10068.html


Report this post
Top
  
Reply with quote  
PostPosted: November 19th, 2008, 4:02 pm 
Offline

Joined: June 4th, 2005, 1:54 am
Posts: 146
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: fkee3
PostPosted: November 19th, 2008, 4:03 pm 
Offline

Joined: June 4th, 2005, 1:54 am
Posts: 146
JoeSchmoe as guest wrote:


And reach all the way to the F keys?

Or am I missing something?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 19th, 2008, 4:10 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 19th, 2008, 4:14 pm 
Offline

Joined: June 4th, 2005, 1:54 am
Posts: 146
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 24th, 2010, 2:27 pm 
Offline

Joined: August 18th, 2009, 12:07 pm
Posts: 375
Location: holland
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"


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Google Feedfetcher, JamixZol, rbrtryn and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group