Tilde-Präfix an KeyUp-Hotkey

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

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

Tilde-Präfix an KeyUp-Hotkey

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: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Tilde-Präfix an KeyUp-Hotkey

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'.

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 106 guests