我需要在curses中创建两个文本框并在按下时在它们之间切换Enter
当我为第二个文本框按 Enter 键时,此代码将光标放在屏幕的左上角,我无法阻止它。
import curses
import curses.textpad as textpad
def main(screen):
"""screen is a curses screen passed from the wrapper"""
while True:
event = screen.getch()
if event :
textpad.Textbox(curses.newwin(1,13,4,0), insert_mode=True).edit()
textpad.Textbox(curses.newwin(1,13,4,16), insert_mode=True).edit()
screen.refresh()
if __name__ == '__main__':
curses.wrapper(main)