-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyboardControl.py
More file actions
65 lines (45 loc) · 1.43 KB
/
Copy pathKeyboardControl.py
File metadata and controls
65 lines (45 loc) · 1.43 KB
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
import pyautogui
import math
class keyboardControl():
def __init__(self):
pyautogui.FAILSAFE = False
def alert(self, t):
pyautogui.alert(text = t, title = 'mode change', button = 'OK', timeout=800)
def nothing(self):
pass
def altTab (self):
pyautogui.hotkey('alt', 'tab')
def ctrlTab (self):
pyautogui.hotkey('ctrl', 'tab')
def ctrlShiftTab (self):
pyautogui.hotkey('ctrl','shift', 'tab')
def scrollDown(self):
pyautogui.scroll(-600)
def scrollUp(self):
pyautogui.scroll(600)
def winTab(self):
pyautogui.hotkey('win', 'tab')
def rightArrow(self):
pyautogui.press('right')
def leftArrow(self):
pyautogui.press('left')
def click(self):
pyautogui.click()
def rightClick(self):
pyautogui.rightClick()
def moveMouse(self, firstMove, newPos):
if firstMove:
self.mousePos = newPos
else:
pyautogui.move(5 * int(self.mousePos[0] - newPos[0]), 5 * int(newPos[1] - self.mousePos[1]))
self.mousePos = newPos
def enter(self):
pyautogui.press('enter')
def volumeMute(self):
pyautogui.press('volumemute')
def volumeup(self):
pyautogui.press('volumeup')
def volumedown(self):
pyautogui.press('volumedown')
def playpause(self):
pyautogui.press('playpause')