Reputation: 3
I have been making a game using pygame in python and it refuses to identify the 1 key.
if event.type == KEYDOWN and event.key == K_1:
print("pass")
started = True
I added the "pass" to check if something else is wrong but nothing happens. I have used a few other keys like up, down, w, s and enter which work but it won't recognize any numbers.
If it helps, I am using a Trust Xpress wireless keyboard. In regard to Dominic's question , I have tried both number pad and standard keys.
Upvotes: 0
Views: 261
Reputation: 1967
Your problem probably has nothing to do with your keyboard.
You probably just left numb lock off and are using the keypad.
If not, get the window to print all events and see if anything comes up when you press the 1 key.
It should be 49
, but if it's not, just use whatever it is.
If nothing comes up at all, and you can't use the keyboard elsewhere, then it is something wrong with your keyboard.
Upvotes: 1