return old;
}
+static bool process_global_keys(struct cui *cui, int key)
+{
+ switch (key) {
+ case 0xc:
+ if (cui->current && cui->current->main_ncw) {
+ redrawwin(cui->current->main_ncw);
+ wrefresh(cui->current->main_ncw);
+ }
+ return true;
+ }
+ return false;
+}
+
/**
* cui_process_key - Process input on stdin.
*/
assert(cui->current);
ui_timer_disable(&cui->timer);
- cui->current->process_key(cui->current);
+ for (;;) {
+ int c = getch();
+
+ if (c == ERR)
+ break;
+
+ if (process_global_keys(cui, c))
+ continue;
+
+ cui->current->process_key(cui->current, c);
+ }
return 0;
}