P
P
Povsekakiy Ivanov2014-11-08 19:57:11
Python
Povsekakiy Ivanov, 2014-11-08 19:57:11

How to connect a module to intercept keypress events in Python?

Hello.
There is a prototype of a console game in Python (without PyGame and object-oriented programming - it happened), the user must press three keys, the game processes them as input, that is, after pressing the key, you also need to press "Enter", how not to force the user to do this ? That is, after pressing a certain key, the program reacts to it without pressing "Enter". What library should be connected to the program for this?
Thanks in advance to all who respond.
PS Game for Linux.
PPS Python 3.4.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2014-11-11
@BasmanovDaniil

Or use https://docs.python.org/3.4/library/curses.html
Or use https://pypi.python.org/pypi/getch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question