Tilde-Präfix an KeyUp-Hotkey

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Tilde-Präfix an KeyUp-Hotkey

Post by Rohwedder » 17 Oct 2021, 10:17

Die Q-Taste ist nach der Auslösung von ~q Up:: logisch losgelassen, wie der ToolTip-Timer zeigt.
Warum bleibt LCtrl nach ~LCtrl Up:: (zuerst) logisch gedrückt?

Code: Select all

SetTimer,State,200,Keys:="q LCtrl"
State: ;Keys separated with space or tab
For all,Key in StrSplit(Keys,[A_Space,A_Tab])
	Text.=Trim(Key)>""?"`n" Key "`t" (GetKeyState(Key)?"down":"up"):
MouseGetPos, MX, MY ;separated from another ToolTip
ToolTip,% SubStr(Text,2),MX+16,MY+32,4,Text:=""
Return
q::
IF GetKeyState(A_ThisHotkey)
	Return
SoundBeep, 4000, 20
Send, {q Down}
Return
~q Up::SoundBeep, 2000, 20
LCtrl::
IF GetKeyState(A_ThisHotkey)
	Return
SoundBeep, 1000, 20
Send, {LCtrl Down}
Return
~LCtrl Up::
SoundBeep, 500, 20
Sleep, 2000
Send, {LCtrl Up}
Return

just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Tilde-Präfix an KeyUp-Hotkey

Post by just me » 18 Oct 2021, 02:59

Moin,

ich kann nur vermuten, dass es mit der Sonderbehandlung der 'Modifikatortasten' zusammenhängt. In der Doku finden sich zarte Hinweise dazu.
GetKeyState("LCtrl", "P") erkennt die Strg Taste jedenfalls als 'losgelassen'.

Post Reply

Return to “Ich brauche Hilfe”