Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get key pressed event

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.

like image 639
Malaka Avatar asked Jan 20 '26 22:01

Malaka


1 Answers

Using Pygame, you care about the Pygame.KEYDOWN keyboard event. You can see how to use it in the pygame example aliens.py.

like image 176
Jason Sundram Avatar answered Jan 23 '26 13:01

Jason Sundram