+ /* Cancel any pending input requests and flush all window buffers */
+ winid_t win;
+ for(win = glk_window_iterate(NULL, NULL); win; win = glk_window_iterate(win, NULL))
+ {
+ switch(win->input_request_type)
+ {
+ case INPUT_REQUEST_CHARACTER:
+ case INPUT_REQUEST_CHARACTER_UNICODE:
+ glk_cancel_char_event(win);
+ break;
+ case INPUT_REQUEST_LINE:
+ case INPUT_REQUEST_LINE_UNICODE:
+ glk_cancel_line_event(win, NULL);
+ break;
+ case INPUT_REQUEST_NONE:
+ default:
+ ; /* Handle mouse and hyperlink requests */
+ }
+
+ flush_window_buffer(win);
+ }
+