-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analog_Buttons.py
39 lines (32 loc) · 1006 Bytes
/
Analog_Buttons.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
#_*_coding:utf-8_*
from C_SendKey import PressKey,ReleaseKey
import time
class AnalogButton(object):
interval = 0.15
DIK_F10 = 0x44
DIK_F12 = 0x58
def __index__(self):
super(AnalogButton,self).__init__()
def PressKeyAndReleaseKey(self,Keyboardcode):
PressKey(Keyboardcode)
time.sleep(AnalogButton.interval)
ReleaseKey(Keyboardcode)
def PressKeyAndReleaseKeyArray(self,KeyboardArray):
for keyboar in KeyboardArray:
self.PressKeyAndReleaseKey(keyboar)
def PressKeyDown(self,Keyboardcode):
PressKey(Keyboardcode)
def PressKeyUp(self,Keyboardcode):
ReleaseKey(Keyboardcode)
def Again(self,flag):
if (flag):
self.PressKeyAndReleaseKey(AnalogButton.DIK_F10)
return 1
else:
return -1
def BackCity(self,flag):
if (flag):
self.PressKeyAndReleaseKey(AnalogButton.DIK_F12)
return 1
else:
return -1