Alt plus 2 keys hotkey

Get help with using AutoHotkey and its commands and hotkeys
gazmoz17
Posts: 19
Joined: 14 Mar 2018, 09:37

Alt plus 2 keys hotkey

20 Jul 2018, 03:22

I’ve read some articles and reverse engineered a few things but...

Program I’m in has existing shortcut alt f x (to close a the software program) I don’t want to assign a single key to replicate this as there’s too many to remember and I’m familiar with existing shortcut sequence.

But don’t know how to write beginning of the script, I get errors at first line (alt f x)

!fx:
Send, {LAlt Down}n{LAlt Up}
Return
The alt n press closes a window pop ub box which asks you to confirm if the program wants to be backed up. n being no

Similarly existing program short cut alt 01

I want to press alt 01 and then get that to send tab 3 times?
!01::
Send, {tab}
Sleep 250
Send, {tab}
Sleep 250
Send, {tab}
Return

Many Thanks in advance
Rohwedder
Posts: 1361
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Alt plus 2 keys hotkey

20 Jul 2018, 13:54

Hallo,
do not press a key combination but LAlt and two keys in sequence: eg.: LAlt 0 1

Code: Select all

~LAlt::
	LAlt2Keys = LAlt
	While, (StrLen(LAlt2Keys) < 6)
	{
		Input, Key, L1
		If !InStr("013",Key)		
			Break
		LAlt2Keys .= Key, Key := ""
	}
	If IsLabel(LAlt2Keys)
		Gosub %LAlt2Keys%
	LAlt2Keys =
	Send, % Key
Return
LAlt01:
	Send, {tab}
	Sleep 250
	Send, {tab}
	Sleep 250
	Send, {tab}
Return
LAlt10:
	MsgBox, LAlt2Keys = LAlt10
Return	
LAlt31:
	MsgBox, LAlt2Keys = LAlt31
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 26 guests