I have a problem where ctypes.windll.user32.GetKeyState won't detect keys on my keyboard (A, B, C, e.t.c), but it does detect the left and right mouse buttons.
I am trying to make a simple script which detects the lowercase "a" key. I got the number 97 by doing ord('a').
import ctypes
def a_pressed():
return ctypes.windll.user32.GetKeyState(97) > 1
while True:
if a_pressed():
print('a is pressed')
Am I doing something wrong or is it just some limitation of the API that I don't know about?