def main_loop():
while 1:
time.sleep(0.001)
c = mainwindow.getch()
if c == ord('/'):
word = search_window.enter()
found = game_menu.find_word(word)
game_menu.center(found)
if c == ord('j') or c == curses.KEY_DOWN:
game_menu.move_down()
if c == ord('k') or c == curses.KEY_UP:
game_menu.move_up()
if c == ord('n'):
word = search_window.text.gather().strip()
found = game_menu.find_next(word)
game_menu.center(found)
if c == ord('N'):
word = search_window.text.gather().strip()
found = game_menu.find_prev(word)
game_menu.center(found)
if c == ord('\n') or c == ord('l'):
cg = game_menu.current_game()
launch_game(cg)
if c == ord('q'):
return
if c == curses.KEY_RESIZE:
do_resize()
评论列表
文章目录