【问题标题】:What is the difference between wgetch() and getch() in ncurses?ncurses中的wgetch()和getch()有什么区别?
【发布时间】:2021-01-03 17:54:19
【问题描述】:

我已经看过了,但似乎在任何地方都找不到提到的这个。

【问题讨论】:

  • wgetch() 期望 WINDOW 引用/指针,getch() 没有。检查这些函数的参数列表。
  • @Progman 这没有回答问题。这个参数的作用是什么?
  • 最有可能引用 ncurses 库中的 WINDOW 实例。检查code.woboq.org/linux/include/curses.h.html#WINDOW 的定义以及与WINDOW 参数一起使用的可用ncurse 函数的文档。

标签: ncurses getch


【解决方案1】:

getch() 等价于wgetch(stdscr)。函数wgetch 执行指定窗口的wrefresh,然后读取输入。所以getch() 会刷新stdscr 然后等待输入。

更多信息在这里:https://stackoverflow.com/a/22121866/515212

【讨论】:

    猜你喜欢
    • 2012-02-29
    • 1970-01-01
    • 2010-12-03
    • 2010-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多