Not sure if this is a bug or not, just thought I'd post this. Maybe I'm using the expression syntax wrong in this case? Consider the following two hotkey down/up definitions:
Code: Select all
hkprefix := "*"
SetHotkeys:
Hotkey, % hkprefix . key_forward, Forward_axis_on, On
Hotkey, % hkprefix . key_forward up, Forward_axis_off, On
Hotkey, %hkprefix%%key_back%, Back_axis_on, On
Hotkey, %hkprefix%%key_back% up, Back_axis_off, On
This turned key_forward into a toggle.
The second hotkey, key_back, kind of worked, but at least not as a toggle. I say kind of, because both versions apparently turned key repeat on again
To prevent that I used the trick from "lexikos", last post (so far, of Mar 05, 2018) here: viewtopic.php?t=45020
Which worked great until now. The trick was to turn off and then on again the hotkey, to avoid key repeats.
(I'm a bit surprised it worked, I feared the key repeats would sneak in between turning the hotkey off and then on again some time later, but it didn't. Until now that is)
Reposting the trick here:
Code: Select all
1::
Hotkey 1, Off
SendEvent {Blind}{LButton down}
return
1 up::
Hotkey 1, On
SendEvent {Blind}{LButton up}
return
(I've not been successful in using KeyWait).
Sidenote:
This is because I suddenly realised I needed hotkeys to ignore the SHIFT and CTRL keys (for a game). I might look into making separate hotkeys including combinations of those triggering the same label, not sure how that will work yet. Probably at best I just have to repeat the hotkeys 3 more times (no modifier, shift alone, ctrl alone, and combined.. maybe times 2 if including Alt. And times 2 for the up and down events...).
Actually writing this out now it seems like the simplest solution atm. And a short test just now seems to indicate it works
This will then be the initialization for just one hotkey:
Code: Select all
SetHotkeys:
Hotkey, %key_forward%, Forward_axis_on, On
Hotkey, +%key_forward%, Forward_axis_on, On
Hotkey, ^%key_forward%, Forward_axis_on, On
Hotkey, +^%key_forward%, Forward_axis_on, On
Hotkey, %key_forward% up, Forward_axis_off, On
Hotkey, +%key_forward% up, Forward_axis_off, On
Hotkey, ^%key_forward% up, Forward_axis_off, On
Hotkey, +^%key_forward% up, Forward_axis_off, On
EDIT: Typo