Trouble with curses module in terminalemulator

teo teo at crepido.com
Wed Aug 1 10:25:45 EDT 2001


Hi all! 

When i try to catch curses.KEY_ENTER, for example, getch() returns
something completley diffrent :)
well, i'll give you my code and explains below.

----------------------------------
import curses

curses.initscr()
win = curses.newwin(0,0,0,0)
win.keypad(1)
win.refresh()

while 1:
  ch = win.getch()
  if ch == curses.KEY_ENTER:
    win.addstr(10,10,"Enter pressed")
    win.refresh()

-------------------------------------

The strange thing is, that other constants work, for example
curses.KEY_RESIZE, but no "keyboard-keys"(enter, tab, backspace)

When i run my application in pure textmode (no X server), it works,
but when i run my app in a terminalemulator, the mapping of the keys
failes.

Any suggestions?

Thanks,
Teodor



More information about the Python-list mailing list