From 6cad3b323124e98c016e0f94d32ee75dcf2dd4d1 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 6 Aug 2008 14:04:16 +0000 Subject: [PATCH] Added support for DEL as well as BS for backspacing in the game select menu. Also limited input to ASCII characters. --- src/emu/uimenu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index 408fc7d54f1..349dee245fc 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -2858,7 +2858,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para int buflen = strlen(menustate->search); /* if it's a backspace and we can handle it, do so */ - if (event->unichar == 8 && buflen > 0) + if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0) { *(char *)utf8_previous_char(&menustate->search[buflen]) = 0; menustate->rerandomize = TRUE; @@ -2866,7 +2866,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para } /* if it's any other key and we're not maxed out, update */ - else if (event->unichar >= ' ') + else if (event->unichar >= ' ' && event->unichar < 0x7f) { buflen += utf8_from_uchar(&menustate->search[buflen], ARRAY_LENGTH(menustate->search) - buflen, event->unichar); menustate->search[buflen] = 0;