
# https://www.globalsino.com/ICs/page4853.html
# Turn off Num Lock

import ctypes

def turn_off_numlock():
    VK_NUMLOCK = 0x90
    KEYEVENTF_EXTENDEDKEY = 0x01
    KEYEVENTF_KEYUP = 0x02
    GetKeyState = ctypes.windll.user32.GetKeyState
    keybd_event = ctypes.windll.user32.keybd_event
    if GetKeyState(VK_NUMLOCK) == True:
        keybd_event(VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0)
        keybd_event(VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0)

turn_off_numlock()




