[F] Fix spicetools not picking up presses
This commit is contained in:
+7
-10
@@ -4,6 +4,7 @@ import time
|
|||||||
import serial
|
import serial
|
||||||
import re
|
import re
|
||||||
from vk import *
|
from vk import *
|
||||||
|
import winsound
|
||||||
|
|
||||||
# Configure your serial port and baud rate
|
# Configure your serial port and baud rate
|
||||||
SERIAL_PORT = 'COM3' # Replace 'COMx' with your serial port (e.g., 'COM3' on Windows or '/dev/ttyUSB0' on Linux)
|
SERIAL_PORT = 'COM3' # Replace 'COMx' with your serial port (e.g., 'COM3' on Windows or '/dev/ttyUSB0' on Linux)
|
||||||
@@ -36,18 +37,14 @@ def parse_uid(data):
|
|||||||
PATH.write_text(uid)
|
PATH.write_text(uid)
|
||||||
|
|
||||||
# Play audio effect
|
# Play audio effect
|
||||||
# If is Windows, use winsound
|
winsound.PlaySound(str(AUDIO_EFFECT), winsound.SND_FILENAME)
|
||||||
if os.name == 'nt':
|
|
||||||
import winsound
|
|
||||||
winsound.PlaySound(str(AUDIO_EFFECT), winsound.SND_FILENAME)
|
|
||||||
else:
|
|
||||||
from playsound import playsound
|
|
||||||
playsound(str(AUDIO_EFFECT))
|
|
||||||
|
|
||||||
# Press scan button
|
# Press scan button
|
||||||
press_key()
|
for i in range(3):
|
||||||
time.sleep(2)
|
press_key()
|
||||||
release_key()
|
time.sleep(0.1)
|
||||||
|
release_key()
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
return uid
|
return uid
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
pyserial
|
pyserial
|
||||||
playsound
|
|
||||||
pynput
|
pynput
|
||||||
Reference in New Issue
Block a user