Tilde-Präfix an KeyUp-Hotkey

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Tilde-Präfix an KeyUp-Hotkey

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

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

Top