Liunx下有没有TC下getch()函数,接受一个字符不回显!

Liangao 2004-07-12 03:12:15
谢谢!
...全文
98 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjp6688 2004-07-12
  • 打赏
  • 举报
回复
up
pacman2000 2004-07-12
  • 打赏
  • 举报
回复
就是getch()啊。
peter9606 2004-07-12
  • 打赏
  • 举报
回复
NAME
getch, wgetch, mvgetch, mvwgetch - get a single-byte character from the terminal
SYNOPSIS


#include <curses.h>

int getch(void);

int mvgetch(int y, int x);

int mvwgetch(WINDOW *win, int y, int x);

int wgetch(WINDOW *win);


DESCRIPTION
These functions read a single-byte character from the terminal associated with the current or specified window. The results are unspecified if the input is not a single-byte character. If keypad() is enabled, these functions respond to the pressing of a function key by returning the corresponding KEY_ value defined in <curses.h>.
Processing of terminal input is subject to the general rules described in Input Processing .

If echoing is enabled, then the character is echoed as though it were provided as an input argument to addch(), except for the following characters:

<backspace>, <left-arrow> and the current erase character: The input is interpreted as specified in and then the character at the resulting cursor position is deleted as though were called, except that if the cursor was originally in the first column of the line, then the user is alerted as though were called.
Function keys The user is alerted as though were called. Information concerning the function keys is not returned to the caller.


If the current or specified window is not a pad, and it has been moved or modified since the last refresh operation, then it will be refreshed before another character is read.

RETURN VALUE
Upon successful completion getch(), mvgetch(), mvwgetch() and wgetch() return the single-byte character, KEY_ value, or ERR. When in the nodelay mode and no data is available, ERR is returned.
ERRORS
No errors are defined.

70,037

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧