-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathxdotool.ahk
71 lines (56 loc) · 1.55 KB
/
xdotool.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
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifwinactive ^xdo
j::
msgbox xdo
DllCall(A_ScriptDir . "\xdotool.dll.so\xmousemove"
, "int", -20, "int", 0, "int", 1, "cdecl")
return
l::
msgbox xdo
DllCall(A_ScriptDir . "\xdotool.dll.so\xmousemove"
, "int", 20, "int", 0, "int", 1, "cdecl")
return
#ifwinactive
p::
coordmode, mouse, screen
mousegetpos, xa, ya
DllCall(A_ScriptDir . "\xdotool.dll.so\xmousegetpos"
, "int *", x, "int *", y, "int *", screen, "cdecl")
msgbox % "mouse pos from x11 `n" . x . "`n" . y . "`n" . screen
msgbox % "mouse pos from ahk" . xa . "`n" . ya . "`n" . title
return
c::
DllCall(A_ScriptDir . "\xdotool.dll.so\xmousegetpos"
, "int *", x, "int *", y, "int *", screen, "cdecl")
inputbox, button, button
DllCall(A_ScriptDir . "\xdotool.dll.so\xmouseclick"
, "int", x, "int", y, "int", button, "int", 0, "cdecl")
DllCall(A_ScriptDir . "\xdotool.dll.so\xmouseclick"
, "int", x, "int", y, "int", button, "int", 1, "cdecl")
return
y::
ifwinactive xdo
msgbox xdo is active
else
msgbox xdo is not active
return
t::
title = xdo
WinGetTitle, ahktitle, % title
xdoid := DllCall(A_ScriptDir . "\xdotool.dll.so\xwingetid"
, "str", title, "cdecl UInt")
current := DllCall(A_ScriptDir . "\xdotool.dll.so\xwingettitle"
, "cdecl UInt")
msgbox % xdoid . "`n" . current . "`n" . ahktitle
return
a::
DllCall(A_ScriptDir . "\xdotool.dll.so\xwinactivate"
, "str", "xdo", "cdecl UInt")
return
r::
DllCall(A_ScriptDir . "\xdotool.dll.so\xwinrestore"
, "str", "xdo", "cdecl UInt")
return
m::
DllCall(A_ScriptDir . "\xdotool.dll.so\xwinmove"
, "str", "xdo", "int", 100, "int", 100, "cdecl UInt")
return