Retaining the original function of hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Batsmaru0410
Posts: 12
Joined: 19 Jan 2019, 12:25

Retaining the original function of hotkey

10 Feb 2019, 02:09

Hi, I have set my Right, Left, Down, Up arrow keys as hotkey, but I also want to retain their original function.

I have searched the forum to and found to add "~" if front of hotkey. So I add ~ infront of Right, Left, Up, Down, but it doesn't work.

Below is my code

Code: Select all

#IfWinActive, WindowA

Right::
Left::
Up::
Down::
	CurrentDir1 := A_ThisHotkey
	return

#If

Delete::	
 	if (HitToggle1 := !HitToggle1){
		SetTimer, Hit1, 250	
		GoSub, Hit1		
	} else {
		SetTimer, Hit1, Off
	}
  	return
  
Hit1:
	if (IsSpace1 := !IsSpace1)
		key1 := "Space"
	else
		key1 := CurrentDir1

	ControlSend, ahk_parent, % "{" key1 "}", WindowA
  	return
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Retaining the original function of hotkey

10 Feb 2019, 03:37

Hallo,
try:

Code: Select all

#IfWinActive, WindowA

~Right::
~Left::
~Up::
~Down::
	CurrentDir1 := SubStr(A_ThisHotkey,2)
return

#If

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333, Google [Bot] and 362 guests