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

Arrows Input #18

Open olls opened 10 years ago

olls commented 10 years ago

Detecting the arrow keys with the nbinput module would be very useful. I need to work out how to do it, as at it seems to come through as multiple characters as it is set up at the moment.

geraintwhite commented 10 years ago

This can't be done using sys.stdin. You must use GUI libraries or Curses which will return keysyms. sys.stdin.read(n) can read n chars at a time, but will block the shell while doing so. sys.stdin.readline() will read until a line break (enter).

olls commented 10 years ago

I think it is possible, It gives a sequence of key presses when I press them in my tests, I just need to detect that sequence.

olls commented 10 years ago

I definatly don't want to use curses or another big library, because this is a similar libray to them.

olls commented 8 years ago

Updating to newer version on nbinput (used in Pycraft) will fix this.