Python 检测键盘大写开关


import ctypes
import win32api


def
check_caps_lock_status(): # 检测键盘是否大写 is_caps_lock_on = ctypes.windll.user32.GetKeyState(0x14) != 0 if is_caps_lock_on: # 关闭大写状态 win32api.keybd_event(0x14, 0, 0, 0) win32api.keybd_event(0x14, 0, 2, 0)

 

posted @ 2023-08-22 14:43  你说夕阳很美  阅读(398)  评论(0)    收藏  举报