+ if (c == 27) {
+ /*
+ * If this is a console code sequence try to parse it
+ * and don't treat this as a key press.
+ */
+ grab = getch();
+ if (grab != ERR && grab != 27) {
+ ungetch(grab);
+ pb_debug("%s: Caught unhandled command sequence\n",
+ __func__);
+ sequence = handle_control_sequence(cui, c);
+ pb_debug("Caught sequence ");
+ if (sequence) {
+ pb_debug("(%zu): ", strlen(sequence));
+ for (i = 0; i < strlen(sequence); i++)
+ pb_debug("0%o ", sequence[i]);
+ pb_debug("\n");
+ } else
+ pb_debug("(0): (none)\n");
+ continue;
+ }
+ }
+
+ if (cui->preboot_mode) {
+ /* Turn curses options back on if the user interacts */
+ cui->preboot_mode = false;
+ cui_set_curses_options(true);
+ }
+
+ if (!cui->has_input && key_cancels_boot(c)) {