Open olls opened 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).
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.
I definatly don't want to use curses or another big library, because this is a similar libray to them.
Updating to newer version on nbinput
(used in Pycraft) will fix this.
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.