simplified the code a little, corrected some hasty statements.

This commit is contained in:
Ben Gras 2009-02-04 17:30:01 +00:00
parent 6a0e8e3b80
commit bb18be5d06

View File

@ -454,13 +454,6 @@ message *m;
} }
/*===========================================================================*
* map_key0 *
*===========================================================================*/
/* Map a scan code to an ASCII code ignoring modifiers. */
#define map_key0(scode) \
((unsigned) keymap[(scode) * MAP_COLS])
/*===========================================================================* /*===========================================================================*
* map_key * * map_key *
*===========================================================================*/ *===========================================================================*/
@ -472,12 +465,10 @@ int scode;
int caps, column, lk; int caps, column, lk;
u16_t *keyrow; u16_t *keyrow;
if (scode == SLASH_SCAN && esc) return '/'; /* don't map numeric slash */
if(esc) if(esc)
keyrow = &keymap[scode * MAP_COLS];
else
keyrow = &keymap_escaped[scode * MAP_COLS]; keyrow = &keymap_escaped[scode * MAP_COLS];
else
keyrow = &keymap[scode * MAP_COLS];
caps = shift; caps = shift;
lk = locks[ccurrent]; lk = locks[ccurrent];
@ -771,12 +762,13 @@ int scode; /* scan code of key just struck or released */
esc = 1; /* Next key is escaped */ esc = 1; /* Next key is escaped */
return(-1); return(-1);
default: /* A normal key */ default: /* A normal key */
if(!ch) { if(!make)
printf("tty: ignoring unrecognized %s scancode 0x%x\n", return -1;
esc ? "escaped" : "straight", scode); if(ch)
return -1; return ch;
} printf("tty: ignoring unrecognized %s scancode 0x%x\n",
if(make) return(ch); escape ? "escaped" : "straight", scode);
return -1;
} }
/* Key release, or a shift type key. */ /* Key release, or a shift type key. */