-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP_PPT.py
125 lines (100 loc) · 2.96 KB
/
P_PPT.py
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
##############################
# import
##############################
import wx
import win32api,win32con,win32com.client,win32gui
import pynput
#from pynput.keyboard import Key
#from pynput.mouse import Button
import GUI_PPT
##############################
# GUI的函数桥接
##############################
class CalcFrame(GUI_PPT.Main):
def __init__(self, parent):
# 定义主函数
GUI_PPT.Main.__init__(self, parent)
X = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)
Y = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)
self.Move((X-600)/2,Y-50)
self.SetTransparent(150)
def Left( self, event ):
mouse = pynput.mouse.Controller()
mouse.move(0, -100)
mouse.press(pynput.mouse.Button.left)
mouse.release(pynput.mouse.Button.left)
mouse.scroll(0, 1)
def Right( self, event ):
mouse = pynput.mouse.Controller()
mouse.move(0, -100)
mouse.press(pynput.mouse.Button.left)
mouse.release(pynput.mouse.Button.left)
mouse.scroll(0, -1)
def rightcilck(self, event):
mouse = pynput.mouse.Controller()
mouse.move(-100, -100)
mouse.press(pynput.mouse.Button.right)
mouse.release(pynput.mouse.Button.right)
mouse.press(pynput.mouse.Button.right)
mouse.release(pynput.mouse.Button.right)
def quit(self, event):
mouse = pynput.mouse.Controller()
mouse.move(0, -100)
mouse.press(pynput.mouse.Button.left)
mouse.release(pynput.mouse.Button.left)
keyboard = pynput.keyboard.Controller()
keyboard.press(pynput.keyboard.Key.esc)
keyboard.release(pynput.keyboard.Key.esc)
##self.Destroy()
def pen(self, event):
mouse = pynput.mouse.Controller()
mouse.move(0, -100)
mouse.press(pynput.mouse.Button.left)
mouse.release(pynput.mouse.Button.left)
keyboard = pynput.keyboard.Controller()
keyboard.press(pynput.keyboard.Key.ctrl)
keyboard.press('p')
keyboard.release(pynput.keyboard.Key.ctrl)
keyboard.release('p')
def eraser(self, event):
mouse = pynput.mouse.Controller()
mouse.move(0, -100)
mouse.press(pynput.mouse.Button.left)
mouse.release(pynput.mouse.Button.left)
keyboard = pynput.keyboard.Controller()
keyboard.press(pynput.keyboard.Key.ctrl)
keyboard.press('e')
keyboard.release(pynput.keyboard.Key.ctrl)
keyboard.release('e')
'''
def PPT_check(self, event):
if proc_exist('POWERPNT.EXE'):
event.Skip()
else:
win32gui.EnumWindows(handle_window, None)
def Main_quit(self, event):
win32gui.EnumWindows(handle_window, None)
'''
'''
def enter(self, event):
self.SetTransparent(255)
def leave(self, event):
self.SetTransparent(100)
'''
##############################
# 主函数
##############################
def main():
app = wx.App(False)
frame = CalcFrame(None)
frame.Show(True)
app.MainLoop()
def proc_exist(process_name):
is_exist = False
wmi = win32com.client.GetObject('winmgmts:')
processCodeCov = wmi.ExecQuery('select * from Win32_Process where name=\"%s\"' % process_name)
if len(processCodeCov) > 0:
is_exist = True
return is_exist
if __name__ == "__main__":
main()