Remap hotkeys per app but allow hold and release

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
atwright147
Posts: 2
Joined: 16 Jan 2018, 13:38
Contact:

Remap hotkeys per app but allow hold and release

16 Jan 2018, 15:25

Hey,

I am trying to remap some button on a bluetooth remote for use with a few art programs. I have a working script which works with Photoshop etc but I want to vary the key for Artrage and I believe I have succeeded in this. However, I also want to be able to hold and release the key (rather than have it press and immediately release.

Here is my code:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#InstallKeybdHook

SetTimer, WatchWin, 2000 ;Checks the window every 2 seconds

WatchWin:
WinGetActiveTitle, ActiveTitle
If ActiveTitle Contains Photoshop, CameraRaw_WindowClass, CLIP STUDIO PAINT, ArtRage
{
	Volume_Up::]
	Volume_Down::[
	Media_Prev::^z
	Media_Next::^+z
	Media_Play_Pause::
	If ActiveTitle Contains ArtRage
		Send, +c
	Else
		Send, i
	Return
	;Browser_Home::Space
	;Volume_Mute::Space
}
Return
If I leave Media_Play_Pause defined as

Code: Select all

Media_Play_Pause::i
Windows treats this as held down until I release the button but when it has the If statement in place (as in the code block (above) is seems to press and immediately release.

Is there a way to accomplish this?
atwright147
Posts: 2
Joined: 16 Jan 2018, 13:38
Contact:

Re: Remap hotkeys per app but allow hold and release

23 Jan 2018, 13:08

Hey,

Have I asked my question wrongly? In the wrong place?

Please advise me how I can get some help with this.

Many thanks,


Andy

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], gabelynn1 and 343 guests