-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTT_Console.ahk
58 lines (43 loc) · 1.19 KB
/
TT_Console.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
TT_Console() v0.03
Use Tooltip as a User Interface
By:
Avi Aryan
Info:
keys - stores space separated values of keys that are prompted for a user input
font_options - Font options as in Gui ( eg -> s8 bold underline )
font_face - Font face names. Separate them by a | to set prority
Returns >
The key which has been pressed
*/
;EXAMPLE
;a := TT_Console( "Hi`nPress Y to see another message.`nPress N to exit script", "y n", empty_var, empty_var, 1, "s12", "Arial|Consolas")
;if a = y
;...
;return
TT_Console(msg, keys, x="", y="", fontops="", fontname="", whichtooltip=1, followMouse=0) {
hFont := getHFONT(fontops, fontname)
TooltipEx(msg, x, y, whichtooltip, hFont)
;create hotkeys
loop, parse, keys, %A_space%, %a_space%
hkZ(A_LoopField, "TT_Console_Check", 1)
is_TTkey_pressed := 0
while !is_TTkey_pressed
{
if followMouse
{
TooltipEx(msg,,, whichtooltip)
sleep 100
} else {
sleep 20
}
}
TooltipEx(,,, whichtooltip)
loop, parse, keys, %A_space%, %a_space%
hkZ(A_LoopField, "TT_Console_Check", 0)
return what_pressed
TT_Console_Check:
what_pressed := A_ThisHotkey
is_TTkey_pressed := 1
return
}