summaryrefslogtreecommitdiff
path: root/src/heretic/mn_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/heretic/mn_menu.c')
-rw-r--r--src/heretic/mn_menu.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index f295c076..369da690 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -1030,6 +1030,7 @@ static boolean SCInfo(int option)
boolean MN_Responder(event_t * event)
{
+ int charTyped;
int key;
int i;
MenuItem_t *item;
@@ -1048,6 +1049,8 @@ boolean MN_Responder(event_t * event)
return (false);
}
key = event->data1;
+ charTyped = event->data2;
+
if (InfoType)
{
if (gamemode == shareware)
@@ -1081,7 +1084,7 @@ boolean MN_Responder(event_t * event)
if (askforquit)
{
- switch (key)
+ switch (charTyped)
{
case 'y':
if (askforquit)
@@ -1413,7 +1416,7 @@ boolean MN_Responder(event_t * event)
{
if (CurrentMenu->items[i].text)
{
- if (toupper(key)
+ if (toupper(charTyped)
== toupper(CurrentMenu->items[i].text[0]))
{
CurrentItPos = i;
@@ -1463,24 +1466,18 @@ boolean MN_Responder(event_t * event)
}
if (slotptr < SLOTTEXTLEN && key != KEY_BACKSPACE)
{
- if ((key >= 'a' && key <= 'z'))
- {
- *textBuffer++ = key - 32;
- *textBuffer = ASCII_CURSOR;
- slotptr++;
- return (true);
- }
- if (((key >= '0' && key <= '9') || key == ' '
- || key == ',' || key == '.' || key == '-') && !shiftdown)
+ if (isalpha(charTyped))
{
- *textBuffer++ = key;
+ *textBuffer++ = toupper(charTyped);
*textBuffer = ASCII_CURSOR;
slotptr++;
return (true);
}
- if (shiftdown && key == '1')
+ if (isdigit(charTyped) || charTyped == ' '
+ || charTyped == ',' || charTyped == '.' || charTyped == '-'
+ || charTyped == '!')
{
- *textBuffer++ = '!';
+ *textBuffer++ = charTyped;
*textBuffer = ASCII_CURSOR;
slotptr++;
return (true);