This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
programming:ncurses [2022/03/19 17:38] nanodano [Important variables and functions] |
programming:ncurses [2022/03/19 23:56] (current) nanodano |
||
---|---|---|---|
Line 309: | Line 309: | ||
+ | ==== Modifier keys ==== | ||
+ | <code cpp> | ||
+ | |||
+ | // int c = getch(); | ||
+ | // switch (c) | ||
+ | case ctrl(' | ||
+ | addstr(" | ||
+ | break; | ||
+ | default: | ||
+ | if (c == KEY_ENTER) { | ||
+ | addstr(" | ||
+ | } | ||
+ | if (c == 27) { // Alt key was down when key pressed | ||
+ | // Get the next char that came with the alt | ||
+ | c = getch(); | ||
+ | addstr(" | ||
+ | addch(c); // could be ' | ||
+ | } | ||
+ | |||
+ | </ | ||