0

How does one apply a keystroke to console code without using Pygame's event checking system. I would prefer something that internalizes the loop and only requires a main running loop.

Scüter
  • 7
  • 1
  • 5

1 Answers1

0

I'm fairly new to Python myself, but when I looked into the tkinter GUI framework I came across a way to make keystrokes perform commands.

Here's the detailed page regarding keyboard strokes, although you probably should read from earlier in the tutorial to get a hang on things: http://infohost.nmt.edu/tcc/help/pubs/tkinter/events.html#key-names

Here's a more detailed example: http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm

Also, this thread might be a different useful way to go about it: Python cross-platform listening for keypresses?

Community
  • 1
  • 1
Lost_DM
  • 941
  • 2
  • 10
  • 24