User Tools

Site Tools


programming:ncurses

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
programming:ncurses [2022/03/19 17:36]
nanodano
programming:ncurses [2022/03/19 23:56] (current)
nanodano
Line 309: Line 309:
  
  
 +==== Modifier keys ====
  
 +<code cpp>
 +
 +// int c = getch();
 +// switch (c)
 +case ctrl('j'): // #define ctrl(x) ((x) & 0x1f)
 + addstr("ctrl j detected");
 + break;
 +default:
 + if (c == KEY_ENTER) {
 + addstr("Keypad enter pressed.");
 + }
 + if (c == 27) { // Alt key was down when key pressed
 + // Get the next char that came with the alt
 + c = getch();
 + addstr("Alt/escaped key pressed: ");
 + addch(c); // could be 'a' or 'A' if alt+shift
 + }
 +
 +</code>
  
  
Line 366: Line 386:
  
  
-mousemask() // Specify which mouse events to get+mousemask(ALL_MOUSE_EVENTS, null) // Specify which mouse events to get 
 +MEVENT // data type with bits set for specific mouse events like BUTTON1_CLICKED
  
 // Special events from wgetch() // Special events from wgetch()
programming/ncurses.1647711367.txt.gz · Last modified: 2022/03/19 17:36 by nanodano