gregster wrote: ↑12 Jul 2022, 16:40
Check the
physical keystate:
Yes- correcting the test version to
Code: Select all
q::
Send, {c down}{c up}
Gosub, StopPlaybackCommand
Exit, ExitCode
StopPlaybackCommand:
Sleep, 555
while GetKeyState("q", "P")
Send, {v down}{v up}
return
works: in that now when the
q is held down stops the playback and not just un-pauses it to pause it gain. But then again- it is only a test, which stops working when
q is replaced with
MButton
As for the second solution
I figured out that I need to do something like
Code: Select all
q::
If !Ta
SetTimer, Ta, -99
Ta++
Return
Ta:
Switch
{ Case GetKeyState("q", "P") : SendInput {v}
Case Ta = 2 : SendInput {c}
Case Ta = 1 : SendInput {c}
}
KeyWait, q
Ta =
Return
which seems to work A-OK - but then again, this is a test version
And once again, after changing all
q's to
MButton's it stops. And a test consisting of pushing quickly
q, pushing it quickly again and then holding it down which looks on History like this
51 010 h d 1.67 q
51 010 s u 0.05 q
43 02E i d 0.06 c
43 02E i u 0.00 c
51 010 h d 0.76 q
51 010 s u 0.05 q
43 02E i d 0.06 c
43 02E i u 0.00 c
51 010 h d 1.41 q
56 02F i d 0.11 v
56 02F i u 0.00 v
51 010 h d 0.16 q
51 010 h d 0.03 q
51 010 h d 0.05 q
51 010 h d 0.03 q
51 010 h d 0.03 q
51 010 h d 0.05 q
51 010 h d 0.03 q
51 010 h d 0.03 q
51 010 h d 0.03 q
51 010 h d 0.05 q
51 010 h d 0.03 q
will look somewhat like this
04 000 h d 3.02 MButton
04 000 # u 0.08 MButton
43 02E i d 0.03 c
43 02E i u 0.00 c
04 000 h d 1.44 MButton
04 000 # u 0.06 MButton
43 02E i d 0.05 c
43 02E i u 0.00 c
04 000 h d 1.03 MButton
43 02E i d 0.11 c
43 02E i u 0.00 c
04 000 # u 1.48 MButton
when also pushing quickly
Middle Mouse Button, pushing it quickly again and then holding it down - which as we can see results with
MButton not being registered multiple times in a row thus not producing
v but only
c [as if
Middle Mouse Button was only quickly pushed for the third time and not held down for few seconds]
And also: in both versions, LButton and
RButton do work when replacing
q- it is only the
MButton that is half-working
And on the side note: in the Help files I found reference only to
Switch and to
! but not to that
Ta element - what is that? I tried replacing it with my descriptive
StopPlaybackCommand but then this script broke the rest of AHK file it was put on