# -*- coding: utf-8 -*-
# curses test

import curses
stdscr = curses.initscr()

curses.noecho()
curses.cbreak()
stdscr.keypad(1)

while 1:
    t = stdscr.getch()
    print(t)
    
    if t == ord('q'):
        break  # Exit the while()

curses.echo() #打开输入回显功能
curses.nocbreak()#关闭字符终端功能（只有回车时才发生终端）
stdscr.keypad(0)


curses.endwin()
