invalid hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Hyo
Posts: 1
Joined: 22 Nov 2017, 18:27

invalid hotkey

22 Nov 2017, 18:43

[Moderator's note: Topic moved from Bug Reports.]

Hi I need some help with AHK script

a & Space::Left
d & Space::Right
w & Space::Up

6::exitapp

"Error at line 1
Line Text: *a & Space::
Error: Invalid hotkey."

I tried to change code to ANSI
nothing.

I tried to change keyboard language to English
nothing.

i tried to use example script with &
"Numpad0 & Numpad2::
Run Notepad"
script started but when i use scrout nothing happend
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: invalid hotkey

22 Nov 2017, 19:12

Maybe a & Space::Send {Left} is sufficent. According to the documentation on remappings, the remapping a::b causes this,

Code: Select all

*a::
SetKeyDelay -1   ; If the destination key is a mouse button, SetMouseDelay is used instead.
Send {Blind}{b DownTemp}  ; DownTemp is like Down except that other Send commands in the script won't assume "b" should stay down during their Send.
return

*a up::
SetKeyDelay -1  ; See note below for why press-duration is not specified with either of these SetKeyDelays.
Send {Blind}{b Up}
return
and since custom combination hotkeys do not accept the wildcard *, you get the error. From custom combination hotkeys documentation
Unlike a normal hotkey, custom combinations act as though they have the wildcard (*) modifier by default.
To mimic the remap, you can try,

Code: Select all

a & space::
	SetKeyDelay -1   
	Send {Blind}{left DownTemp}
return

a & space up::
	SetKeyDelay -1  
	Send {Blind}{left Up}
return
Good luck.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: invalid hotkey

26 Nov 2017, 02:13

Custom combination hotkeys (a & b) and remapping (a::b) are mutually-exclusive; you cannot combine them. This is by design.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: invalid hotkey

27 Dec 2017, 05:59

I realized that it was trivial to support custom combinations for remapping by simply omitting * when space-&-space is detected, so v1.1.27.01 will support it.

However, I think the OP's hotkeys are backwards. They are very awkward to activate, since you must press and hold a/d/w before space. If you swap them around (Space & a::), it is easy to use a/d/w as arrow keys while holding Space.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Billykid, Descolada, Google [Bot], Haris00911, Swiftly9767 and 292 guests