Repository navigation
more fixes - #39
more fixes#39
Conversation
Note that stdscr = initscr()
nodelay(stdscr, True)
noecho()
cbreak()
while True:
ch = getch()
if ch != ERR: # comment this and see what will happen
print(ch) # ignore that i use stdout here for a momment :PWhen |
|
oh, I did not know that! My mistake, will investigate more next time before making such big change |
|
For exampe, here's a use case for capturing escape-sequences\alt-keys, thanks to unicurses/unicurses/__init__.py Lines 690 to 702 in e74617d |
I fixed some of the functions that were taking "ch" as character argument but were missing to apply CCHAR before then.
Some other fixes here and there, most notably now when getch returns -1 the library raise an error. Upon inspection, it looks like -1 is the return code for error when delay is enabled, and as such I thought Python should return an actual TimeoutError. This is clearly up to debate, but previously the library would simply throw away the input, which I am not extremely sure it's the actual wanted behavior. I might be completely wrong here.