我正在尝试使用curses的
textpad.Textbox()
函数进行文本输入。目前一切正常,但有些键无法识别,包括小节符号(§)和所有德语umlauts(ä/ö/ü)。我猜这与文本编码有关,但我不知道如何解决。我的德语键盘布局在input()
中可以完美地工作。
这是一个最简示例:
import curses
import curses.textpad as textpad
try:
stdtscr = curses.initscr()
curses.cbreak()
stdtscr.keypad(1)
curses.noecho()
textpad.Textbox(stdtscr).edit()
finally:
curses.nocbreak()
stdtscr.keypad(0)
curses.echo()
curses.endwin()