import datetime
import threading
import time
import keyboard
import schedule
def block_keyboard():
print("block...", datetime.datetime.now())
for i in range(150):
keyboard.block_key(i)
threading.Timer(10, unblock_keyboard).start()
def unblock_keyboard():
print("unblock...", datetime.datetime.now())
for i in range(150):
keyboard.unblock_key(i)
threading.Timer(10, block_keyboard).start()
def job():
block_keyboard()
threading.Timer(10, unblock_keyboard).start()
if __name__ == '__mAIn__':
print("start...", datetime.datetime.now())
block_keyboard()
# schedule.every(10).seconds.do(job)
# while True:
# schedule.run_pending()
声明:本站部分内容及图片来自互联网,转载是出于传递更多信息之目的,内容观点仅代表作者本人,不构成投资建议。投资者据此操作,风险自担。如有任何标注错误或版权侵犯请与我们联系,我们将及时更正、删除。