olls / graphics

A console based graphics engine for simple Unicode games and animations.
GNU General Public License v3.0
11 stars 4 forks source link

Input #2

Closed olls closed 10 years ago

olls commented 10 years ago

There needs a way to get non blocking input from the user, so you can tell if a key is being pressed. This will make the graphics module much more useful for making interactive programs or games.

geraintwhite commented 10 years ago

Curses

On 8 January 2014 19:16, Oliver Faircliff notifications@github.com wrote:

There needs a way to get non blocking input from the user, so you can tell if a key is being pressed. This will make the graphics module much more useful for making interactive programs or games.

— Reply to this email directly or view it on GitHubhttps://github.com/olls/graphics/issues/2 .

olls commented 10 years ago

I might use it, can I use the input from curses without setting up the whole curses setup. It seems a bit dumb to import a huge graphics library into my own module, which is meant to be a graphics module, just to use one tiny part...

geraintwhite commented 10 years ago

This might help https://stackoverflow.com/questions/2408560/python-nonblocking-console-input

olls commented 10 years ago

"For Windows, console only" :(

olls commented 10 years ago

Didn't we try terminos, I remember the name...

geraintwhite commented 10 years ago

I don't know, but don't you think your first comment was a bit premature?

On 8 January 2014 19:39, Oliver Faircliff notifications@github.com wrote:

Didn't we try terminos, I remember the name...

— Reply to this email directly or view it on GitHubhttps://github.com/olls/graphics/issues/2#issuecomment-31869851 .

olls commented 10 years ago

I commented as I read.

olls commented 10 years ago

This might help https://stackoverflow.com/questions/2408560/python-nonblocking-console-input

Added nbinput.py file based off an answer from this stack overflow. This allows you to run a function which returns a key being pressed without blocking the code or outputting in the terminal, this only works in the Linux terminal. 4c9b4ae07de1986c6144069730b587eb70a9fe1d