Divert text input from current application?

Get help with using AutoHotkey and its commands and hotkeys
teknetik
Posts: 1
Joined: 16 Aug 2018, 16:06

Divert text input from current application?

16 Aug 2018, 16:20

I have been using hotkeys for a while in my home.automation setup (Harmony remote) and have now run out of viable shortcuts (CTRL+ALT+0-9)

What I would like to do is send a single CTRL+ALT+0 sequence to hotkeys and then have it listen to the next sequence but diverting that text input away from the current application.

Example, if I want to use ALT+F4 as a shortcut hotkeys would not pass that to windows and close the current app. This way I could have an unlimited set of shortcuts and not need to worry what effect they would have on the current running application.

sudo code to try explain further:

Code: Select all


^!00:
    if ALT+F4 then
        run myApp1
        Return
    
    elseIf ALT+F5 then
        run myApp2
        Return
        
    else 
       do nothing and pass the sequence as intended 
  
 Return
     

Hope this is clear and welcome any pointers you may have.

thanks!
Rohwedder
Posts: 1430
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Divert text input from current application?

17 Aug 2018, 02:39

Hallo,
try:

Code: Select all

^!0::CTRL_ALT_0 := True
#If CTRL_ALT_0
!F4::
	run myApp1
	CTRL_ALT_0 := False
Return
!F5::
	run myApp2
	CTRL_ALT_0 := False
Return
#If
E.g. press the sequence of the shortcuts CTRL+ALT+0 and Alt+F4

Return to “Ask For Help”

Who is online

Users browsing this forum: bilbofraggings, Bing [Bot], Google [Bot], Mipha, Ruevil2 and 41 guests