Get key pressed event
Question
I'm developing translation software for Linux using Python. I'm looking for a way to get the key pressed event. When an english letter key is pressed, I wan the pressed key to be assigned to a variable.
I've tried googling and reading various articles, but haven't had any luck so far.
Solution
Using Pygame, you care about the Pygame.KEYDOWN
keyboard event. You can see how to use it in the pygame example aliens.py.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow