Parcourir la source

[pxe] Allow Escape to abort PXE menu selections

Other vendor PXE stacks tend to allow the Escape key to be used to
abort menu selection.  Allow Escape (as well as Ctrl-C) to abort
selection.
tags/v0.9.7
Michael Brown il y a 15 ans
Parent
révision
cff419148c
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2
    2
      src/usr/pxemenu.c

+ 2
- 2
src/usr/pxemenu.c Voir le fichier

@@ -247,7 +247,7 @@ static int pxe_menu_select ( struct pxe_menu *menu ) {
247 247
 		if ( ( key == CR ) || ( key == LF ) ) {
248 248
 			pxe_menu_draw_item ( menu, menu->selection, 1 );
249 249
 			break;
250
-		} else if ( key == CTRL_C ) {
250
+		} else if ( ( key == CTRL_C ) || ( key == ESC ) ) {
251 251
 			rc = -ECANCELED;
252 252
 			break;
253 253
 		} else if ( key == KEY_UP ) {
@@ -306,7 +306,7 @@ static int pxe_menu_prompt_and_select ( struct pxe_menu *menu ) {
306 306
 				/* Display menu */
307 307
 				printf ( "\n" );
308 308
 				return pxe_menu_select ( menu );
309
-			} else if ( key == CTRL_C ) {
309
+			} else if ( ( key == CTRL_C ) || ( key == ESC ) ) {
310 310
 				/* Abort */
311 311
 				rc = -ECANCELED;
312 312
 				break;

Chargement…
Annuler
Enregistrer