我有这段代码,我尝试了所有我能找到的禁用鼠标和键盘的方法。但是没有任何人可以帮助我吗?
import playsound
from pynput.keyboard import Key,Controller
import time
from ctypes import *
# do something
keyboard = Controller()
keyboard.press(Key.media_play_pause )
keyboard.release(Key.media_play_pause )
ok = windll.user32.BlockInput(True)
playsound.playsound(r'C:/Users/........')
ok = windll.user32.BlockInput(False)
keyboard.press(Key.media_play_pause )
keyboard.release(Key.media_play_pause )