?? demo_keyok.c
字號(hào):
/* * $Id: demo_keyok.c,v 1.3 2003/05/17 23:18:34 tom Exp $ * * Demonstrate the keyok() function. * Thomas Dickey - 2002/11/23 */#include <test.priv.h>#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCSintmain(int argc GCC_UNUSED, char *argv[]GCC_UNUSED){ int lastch = ERR; int ch; WINDOW *win; initscr(); (void) cbreak(); /* take input chars one at a time, no wait for \n */ (void) noecho(); /* don't echo input */ printw("Typing any function key will disable it, but typing it twice in\n"); printw("a row will turn it back on (just for a demo)."); refresh(); win = newwin(LINES - 2, COLS, 2, 0); scrollok(win, TRUE); keypad(win, TRUE); wmove(win, 0, 0); while ((ch = wgetch(win)) != ERR) { const char *name = keyname(ch); wprintw(win, "Keycode %d, name %s\n", ch, name != 0 ? name : "<null>"); wclrtoeol(win); wrefresh(win); if (ch >= KEY_MIN) { keyok(ch, FALSE); lastch = ch; } else if (lastch >= KEY_MIN) { keyok(lastch, TRUE); } } endwin(); return EXIT_SUCCESS;}#elseintmain(void){ printf("This program requires the ncurses library\n"); ExitProgram(EXIT_FAILURE);}#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -