-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwheel-zoom-win.ahk
99 lines (79 loc) · 1.72 KB
/
wheel-zoom-win.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
;SetTimer WatchCursor, 100
;useTransparent := 1
transStepVal := 15 ; 透明度變動單位
;######################
; win-key+Wheel zoom-in and zoom-out
;######################
if !WinExist("ahk_class MagUIClass")
{
Run("Magnify.exe")
WinWait("ahk_class MagUIClass")
; if WinWait("ahk_class MagUIClass")
; MsgBox "放大鏡啟動"
}
;!LButton::
;{
; move windows with Alt
;}
!WheelUp::
{
MouseGetPos ,,&mouseWin
; WinActivate "ahk_id" mouseWin
setTrans := WinGetTransparent(mouseWin)
if (setTrans = "")
{
setTrans := 255 - transStepVal
}
else
{
if (setTrans > transStepVal && setTrans < 256){
setTrans := setTrans - transStepVal
}
}
WinSetTransparent setTrans, "ahk_id " mouseWin
}
!WheelDown::
{
MouseGetPos ,,&mouseWin
; WinActivate "ahk_id" mouseWin
setTrans := WinGetTransparent(mouseWin)
if(setTrans = ""){
Exit
}
if (setTrans < 255)
{
setTrans := setTrans + transStepVal
WinSetTransparent setTrans, "ahk_id" mouseWin
}
}
#WheelUp::
{
Send "#="
}
#WheelDown::
{
Send "#-"
}
;; invert window color
#n::
{
Send "^!i"
;active_id := WinGetID("A")
;MouseGetPos ,,&mouseWin
;wTitle := WinGetTitle(mouseWin)
;MsgBox "The active window's ID is " wTitle
}
#o::
{
appName := "Skype"
WinGetPos &skypeX, &skypeY,,,appName
; MsgBox "Skype at " skypeX " " skypeY
if( skypeX > 3800) {
WinMove -8,-8,500,1040,appName
WinMaximize appName
WinActivate appName
} else {
WinRestore appName
WinMove 3831,1076,500,1040, appName
}
}