3
내 상황 : 나는 창 contentWin이의 ncurses - getstr()와 기능 키
- 의 ncurses 모드 에서.
- 이 코드에서이 코드를 통해 "string"을 읽고 싶습니다.
char str [41]; wgetnstr(contentWin, str, 40);
다른 방법이 있습니까? 감사 :-).
내 상황 : 나는 창 contentWin이의 ncurses - getstr()와 기능 키
char str [41];
wgetnstr(contentWin, str, 40);
다른 방법이 있습니까? 감사 :-).
나는 그렇지 않습니다. F2 등을 검사하는 wgetnstr()
과 유사한 함수를 직접 만들 수도 있습니다.
F2를 포착하는 다음 코드에서 함수를 기반으로 할 수 있습니다.
#include <ncurses.h>
int main()
{
int ch;
initscr(); /* Start curses mode */
raw(); /* Line buffering disabled */
keypad(stdscr, TRUE); /* We get F1, F2 etc.. */
noecho(); /* Don't echo() while we do getch */
while((ch = wgetch(stdscr)) != KEY_F(2))
{
printw("Key code: %u Key: %c\n", ch, ch);
refresh(); /* Print it on to the real screen */
}
endwin(); /* End curses mode */
printf("F2 pressed .. program exiting\n");
return(0);
}