need help creating an example script of tool tip
Scenario : when i held down / press down CTRL a tooltip will appear , the tooltip will only dissappear if
1. the CTRL modifier is released
2. when CTRL key is held down then combined with KEYS ( ex. Ctrl + A B C so forth ) or combined with modifier keys ex. ( Ctrl + SHIFT ) ( ctrl + alt ) ( ctrl + alt + shift ) so forth
thank you.
Show Tool Tip When a certain Button is Held down & Removetool Tip when button is Released / Up
-
- Posts: 24
- Joined: 06 Jun 2019, 17:12
Re: Show Tool Tip When a certain Button is Held down & Removetool Tip when button is Released / Up
Hallo,
try:
try:
Code: Select all
~*Ctrl::
ToolTip, only one Ctrl key is down
SetTimer, ~*Ctrl Up, 50
KeyWait, Ctrl
~*Ctrl Up::
IF StrLen(KeyCombination()) = 10
Return
SetTimer, ~*Ctrl Up, Off
ToolTip
Return
KeyCombination(ExcludeKeys:="")
{ ;All pressed keys and buttons will be listed
ExcludeKeys .= "{Shift}{Control}{Alt}{WheelUp}{WheelDown}"
Loop, 0xFF
{
IF !GetKeyState(Key:=Format("VK{:02X}",0x100-A_Index),"P")
Continue
If !InStr(ExcludeKeys,Key:="{" GetKeyName(Key) "}")
KeyCombination .= RegexReplace(Key,"Numpad(\D+)","$1")
}
Return, KeyCombination
}