1 Replies - 1905 Views - Last Post: 27 August 2012 - 08:13 AM Rate Topic: -----

#1 iownall555  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 30-August 11

Read key events in while loops.

Posted 26 August 2012 - 05:58 PM

I was wondering if there was a way to read keypresses in a while loop (for example pressing the "c" key to break the loop and continue the rest of the program). I want to use this with socket.recv() so I can break the loop that receives connections when I press a key.

Is there a module that checks for events or keypresses that I can use in a while loop?
Is This A Good Question/Topic? 0
  • +

Replies To: Read key events in while loops.

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 756
  • View blog
  • Posts: 1,990
  • Joined: 23-December 08

Re: Read key events in while loops.

Posted 27 August 2012 - 08:13 AM

I know Pygame has keyListeners, I'm sure some of the GUI frameworks do too. I realize neither of these are particularly ideal though.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1