Retaining the original function of hotkey

Get help with using AutoHotkey and its commands and hotkeys
Batsmaru0410
Posts: 11
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: 3788
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”

Who is online

Users browsing this forum: Bing [Bot], daywalker, Google [Bot], songdg, TAC109 and 52 guests