NCurses和ESC,ALT键

我有一个NCurses的问题…我需要处理所有的键,如Esc,Alt F等
问题是代码是相似的,即:

Esc – 27

Alt A – 27 65

举个例子,Alt [key]组合有两个代码,类似于Esc键…
任何想法如何处理?

解决方法

这是 python一个例子:
key = self.screen.getch()
if key == ord('q'): # quit
    go = False
elif key == 27: # Esc or Alt
    # Don't wait for another key
    # If it was Alt then curses has already sent the other key
    # otherwise -1 is sent (Escape)
    self.screen.nodelay(True)
    n = self.screen.getch()
    if n == -1:
        # Escape was pressed
        go = False
    # Return to delay
    self.screen.nodelay(False)

相关文章

vue阻止冒泡事件 阻止点击事件的执行 <div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些