I am trying to catch Enter button with pygame, not Enter button on keypad, which I want is the Enter button under Backspace button. They are not same, because when I catch Enter button on keypad, other Enter button is not working.
http://www.pygame.org/docs/ref/key.html
There is a documentation about keys, but there is only keypad Enter button. I tried these codes:
This working for keypad Enter button, but other Enter button is not working:
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_KP_ENTER:
#some codes
I tried to catch another Enter button with these codes(hopeless):
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_ENTER:
#some codes
But of course an error appears:
AttributeError: 'module' object has no attribute 'K_ENTER'
Couldn't figure out how to catch Enter button under Backspace.
I think you want K_RETURN , as the enter key under the backspace is sometimes referred to as "carriage return", from old typewriter lingo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With