-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflute keystrokes.py
38 lines (36 loc) · 954 Bytes
/
flute keystrokes.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
import keyboard
import time
import serial
#Var1=serial.Serial('COM22',9600)
import win32com.client as comclt
Var2=serial.Serial('COM8',9600)
wsh= comclt.Dispatch("WScript.Shell")
while 1:
#data1='z'
#data2='z'
#data1=Var1.read()
data2=Var2.readline().decode('ascii');
'''if data2 == 'a':
keyboard.press("z")
time.sleep(5)
keyboard.release("z")'''
if (data2[0] == 'b'):
keyboard.write('s')
time.sleep(0.5)
keyboard.release('s')
'''if data2 == 'c':
keyboard.press("z")
time.sleep(5)
keyboard.release("z")
if data2 == 'd':
keyboard.press("z")
time.sleep(5)
keyboard.release("z")
if data2 == 'e':
keyboard.press("z")
time.sleep(5)
keyboard.release("z")
if data2 == 'f':
keyboard.press("z")
time.sleep(5)
keyboard.release("z")'''