more MSYS2 warning clean-up

This commit is contained in:
nhmall
2024-12-12 22:35:38 -05:00
parent 8bb764e624
commit c7276bcf67
15 changed files with 227 additions and 156 deletions

View File

@@ -341,12 +341,12 @@ ifeq "$(GCC_EXTRA_WARNINGS)" "Y"
#
CFLAGSXTRA = -Wall -Wextra -Wreturn-type -Wunused -Wswitch -Wshadow \
-Wwrite-strings -pedantic -Wmissing-declarations \
-Wformat-nonliteral -Wunreachable-code -Wimplicit \
-Wunreachable-code -Wimplicit \
-Wimplicit-function-declaration -Wimplicit-int \
-Wmissing-prototypes -Wold-style-definition \
-Wstrict-prototypes -Wnonnull -Wformat-overflow \
-Wmissing-parameter-type -Wimplicit-fallthrough \
-Wno-cast-function-type
-Wno-cast-function-type -Wno-format
CPPFLAGSXTRA = -Wall -Wextra -Wno-missing-field-initializers -Wreturn-type \
-Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -pedantic \

View File

@@ -97,11 +97,27 @@ cell_t clear_cell = { CONSOLE_CLEAR_CHARACTER, CONSOLE_CLEAR_ATTRIBUTE };
cell_t undefined_cell = { CONSOLE_UNDEFINED_CHARACTER,
CONSOLE_UNDEFINED_ATTRIBUTE };
#else /* VIRTUAL_TERMINAL_SEQUENCES */
cell_t clear_cell = { { CONSOLE_CLEAR_CHARACTER, 0, 0, 0, 0, 0, 0 },
CONSOLE_CLEAR_CHARACTER, 0, 0L, 0, "\x1b[0m", 0 };
cell_t undefined_cell = { { CONSOLE_UNDEFINED_CHARACTER, 0, 0, 0, 0, 0, 0 },
CONSOLE_UNDEFINED_CHARACTER, 0, 0L, 0, (const char *) 0 };
cell_t clear_cell = {
{ CONSOLE_CLEAR_CHARACTER, 0, 0, 0, 0, 0, 0 },
CONSOLE_CLEAR_CHARACTER, /* wcharacter */
0, /* attr */
0L, /* color24 */
0, /* color256idx */
"\x1b[0m", /* bkcolorseq */
0 /* colorseq */
};
cell_t undefined_cell = {
{ CONSOLE_UNDEFINED_CHARACTER, 0, 0, 0, 0, 0, 0 },
CONSOLE_UNDEFINED_CHARACTER, /* wcharacter */
0, /* attr */
0L, /* color24 */
0, /* color256idx */
(const char *) 0, /* bkcolorseq */
(const char *) 0 /* colorseq */
};
#if 0
static const uint8 empty_utf8str[MAX_UTF8_SEQUENCE] = { 0 };
#endif
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
/*
@@ -135,7 +151,9 @@ int process_keystroke(INPUT_RECORD *, boolean *, boolean numberpad,
static void init_ttycolor(void);
static void really_move_cursor(void);
static void check_and_set_font(void);
#ifndef VIRTUAL_TERMINAL_SEQUENCES
static boolean check_font_widths(void);
#endif
static void set_known_good_console_font(void);
static void restore_original_console_font(void);
extern void safe_routines(void);
@@ -150,7 +168,7 @@ static void free_custom_colors(void);
/* Win32 Screen buffer,coordinate,console I/O information */
COORD ntcoord;
INPUT_RECORD ir;
INPUT_RECORD gbl_ir;
static boolean orig_QuickEdit;
/* Support for changing console font if existing glyph widths are too wide */
@@ -213,11 +231,11 @@ struct console_t {
0, /* current_nhcolor */
0, /* current_nhbkcolor */
0, /* current_colorflags */
{FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
{0, 0}, /* cursor */
{ FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
{ 0, 0 }, /* cursor */
NULL, /* hConOut*/
NULL, /* hConIn */
{ 0 }, /* cbsi */
{ { 0, 0}, { 0, 0}, 0, { 0, 0, 0, 0 }, { 0, 0 } }, /* cbsi */
0, /* width */
0, /* height */
FALSE, /* has_unicode */
@@ -242,7 +260,9 @@ struct console_t {
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
};
#if 0
static const char default_name[] = "default";
#endif
const char *const legal_key_handling[] = {
"none",
"default",
@@ -282,7 +302,10 @@ struct keyboard_handling_t {
default_checkinput
};
static DWORD ccount, acount;
static DWORD ccount;
#if 0
static DWORD acount;
#endif
#ifndef CLR_MAX
#define CLR_MAX 16
#endif
@@ -292,7 +315,9 @@ int ttycolors_inv[CLR_MAX];
#define MAX_OVERRIDES 256
unsigned char key_overrides[MAX_OVERRIDES];
#if 0
static char nullstr[] = "";
#endif
char erase_char, kill_char;
#define DEFTEXTCOLOR ttycolors[7]
static INPUT_RECORD bogus_key;
@@ -470,7 +495,17 @@ struct rgbvalues {
{ 138, "white", "#FFFFFF", 255, 255, 255 },
};
long
void buffer_fill_to_end(cell_t * buffer, cell_t * fill, int x, int y);
void buffer_write(cell_t * buffer, cell_t * cell, COORD pos);
static long rgbtable_to_long(struct rgbvalues *);
void term_start_256color(int idx);
void set_cp_map(void);
#ifdef PORT_DEBUG
void win32con_debug_keystrokes(void);
void win32con_toggle_cursor_info(void);
#endif
static long
rgbtable_to_long(struct rgbvalues *tbl)
{
long rgblong = (tbl->r << 0) | (tbl->gn << 8) | (tbl->b << 16);
@@ -595,7 +630,7 @@ void emit_start_256color(int u256coloridx);
void emit_default_color(void);
void emit_return_to_default(void);
void emit_hide_cursor(void);
void emit_show_curor(void);
void emit_show_cursor(void);
void
emit_hide_cursor(void)
@@ -730,7 +765,7 @@ emit_stop_inverse(void)
#define tcfmtstr24bit "\x1b[38:2:%ld:%ld:%ldm"
#define tcfmtstr256 "\x1b[38:5:%dm"
#endif
void
emit_start_256color(int u256coloridx)
{
@@ -773,12 +808,14 @@ emit_return_to_default(void)
WriteConsoleA(console.hConOut, (LPCSTR) escseq, (int) strlen(escseq),
&unused, NULL);
}
#if 0
static boolean newattr_on = TRUE;
#endif
static boolean color24_on = TRUE;
/* for debugging */
WORD what_is_there_now;
BOOL success;
//BOOL success;
DWORD error_result;
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
@@ -880,7 +917,7 @@ back_buffer_flip(void)
(int) strlen(back->bkcolorseq), &unused,
NULL);
}
if ((did_anything | (did_colorseq | did_bkcolorseq | did_color24)) == 0) {
if ((did_anything & (did_colorseq | did_bkcolorseq | did_color24)) == 0) {
did_anything &= ~(did_bkcolorseq | did_color24);
did_anything |= did_colorseq;
emit_default_color();
@@ -1050,7 +1087,7 @@ tty_startup(int *wid, int *hgt)
}
void
tty_number_pad(int state)
tty_number_pad(int state UNUSED)
{
// do nothing
}
@@ -1088,6 +1125,7 @@ CtrlHandler(DWORD ctrltype)
case CTRL_BREAK_EVENT:
term_clear_screen();
FALLTHROUGH;
/* FALLTHRU */
case CTRL_CLOSE_EVENT:
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
@@ -1106,7 +1144,7 @@ CtrlHandler(DWORD ctrltype)
/* called by pcmain() and process_options() */
void
consoletty_open(int mode)
consoletty_open(int mode UNUSED)
{
int debugvar;
@@ -1124,6 +1162,7 @@ consoletty_open(int mode)
CO = console.width;
really_move_cursor();
nhUse(debugvar);
}
void
@@ -1165,7 +1204,7 @@ process_keystroke(
int
consoletty_kbhit(void)
{
return keyboard_handling.pNHkbhit(console.hConIn, &ir);
return keyboard_handling.pNHkbhit(console.hConIn, &gbl_ir);
}
int
@@ -1174,20 +1213,20 @@ tgetch(void)
int mod;
coord cc;
DWORD count;
boolean numpad = iflags.num_pad;
uchar numberpad = iflags.num_pad;
really_move_cursor();
if (iflags.debug_fuzzer)
return randomkey();
#ifdef QWERTZ_SUPPORT
if (gc.Cmd.swap_yz)
numpad |= 0x10;
numberpad |= 0x10;
#endif
return (program_state.done_hup)
? '\033'
: keyboard_handling.pCheckInput(
console.hConIn, &ir, &count, numpad, 0, &mod, &cc);
console.hConIn, &gbl_ir, &count, numberpad, 0, &mod, &cc);
}
int
@@ -1196,7 +1235,7 @@ console_poskey(coordxy *x, coordxy *y, int *mod)
int ch;
coord cc = { 0, 0 };
DWORD count;
boolean numpad = iflags.num_pad;
boolean numberpad = iflags.num_pad;
really_move_cursor();
if (iflags.debug_fuzzer) {
@@ -1210,14 +1249,14 @@ console_poskey(coordxy *x, coordxy *y, int *mod)
}
#ifdef QWERTZ_SUPPORT
if (gc.Cmd.swap_yz)
numpad |= 0x10;
numberpad |= 0x10;
#endif
ch = (program_state.done_hup)
? '\033'
: keyboard_handling.pCheckInput(
console.hConIn, &ir, &count, numpad, 1, mod, &cc);
console.hConIn, &gbl_ir, &count, numberpad, 1, mod, &cc);
#ifdef QWERTZ_SUPPORT
numpad &= ~0x10;
numberpad &= ~0x10;
#endif
if (!ch) {
*x = cc.x;
@@ -1245,9 +1284,11 @@ really_move_cursor(void)
if (GetConsoleTitle(oldtitle, BUFSZ)) {
oldtitle[39] = '\0';
}
Sprintf(newtitle, "%-55s tty=(%02d,%02d) consoletty=(%02d,%02d)", oldtitle,
ttyDisplay->curx, ttyDisplay->cury,
console.cursor.X, console.cursor.Y);
Snprintf(newtitle, sizeof newtitle,
"%-55s tty=(%02d,%02d) consoletty=(%02d,%02d)",
oldtitle,
ttyDisplay->curx, ttyDisplay->cury,
console.cursor.X, console.cursor.Y);
(void) SetConsoleTitle(newtitle);
}
#endif
@@ -1315,7 +1356,7 @@ xputc(int ch)
#ifndef VIRTUAL_TERMINAL_SEQUENCES
void
xputc_core(char ch)
xputc_core(char ch)
#else
void
xputc_core(int ch)
@@ -1423,27 +1464,25 @@ xputc_core(int ch)
void
g_putch(int in_ch)
{
unsigned char ch;
cell_t cell;
#ifndef VIRTUAL_TERMINAL_SEQUENCES
boolean inverse = FALSE;
#else /* VIRTUAL_TERMINAL_SEQUENCES */
int ccount = 0;
ccount = 0;
WCHAR wch[2];
boolean usemap = (in_ch >= 0 && in_ch < SIZE(console.cpMap));
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
unsigned char ch = (unsigned char) in_ch;
ch = (unsigned char) in_ch;
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
#ifndef VIRTUAL_TERMINAL_SEQUENCES
inverse = (console.current_nhattr[ATR_INVERSE] && iflags.wc_inverse);
console.attr = (console.current_nhattr[ATR_INVERSE] && iflags.wc_inverse) ?
ttycolors_inv[console.current_nhcolor] :
ttycolors[console.current_nhcolor];
if (console.current_nhattr[ATR_BOLD])
console.attr |= (inverse) ? BACKGROUND_INTENSITY : FOREGROUND_INTENSITY;
#endif /* ! VIRTUAL_TERMINAL_SEQUENCES */
cell_t cell;
#ifndef VIRTUAL_TERMINAL_SEQUENCES
cell.attribute = console.attr;
cell.character = (console.has_unicode ? cp437[ch] : ch);
#else
@@ -1454,7 +1493,7 @@ g_putch(int in_ch)
cell.color256idx = 0;
wch[1] = 0;
if (console.has_unicode) {
wch[0] = (ch >= 0 && ch < SIZE(console.cpMap)) ? console.cpMap[ch] : ch;
wch[0] = (usemap) ? console.cpMap[ch] : ch;
#ifdef UTF8_FROM_CORE
if (SYMHANDLING(H_UTF8)) {
/* we have to convert it to UTF-8 for cell.utf8str */
@@ -1476,7 +1515,7 @@ g_putch(int in_ch)
cell.utf8str[1] = 0;
ccount = 2;
}
#endif
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
buffer_write(console.back_buffer, &cell, console.cursor);
}
@@ -1522,10 +1561,10 @@ term_start_extracolor(uint32 nhcolor, uint16 color256idx)
term_start_color(console.current_nhcolor);
#ifdef VIRTUAL_TERMINAL_SEQUENCES
}
#endif
#endif
}
void term_start_256color(int idx)
void term_start_256color(int idx UNUSED)
{
}
@@ -1542,7 +1581,7 @@ term_end_extracolor(void)
void
cl_end(void)
{
if (ttyDisplay->curx < console.width
if (ttyDisplay->curx < console.width
&& ttyDisplay->cury < console.height) {
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
buffer_clear_to_end_of_line(console.back_buffer, console.cursor.X,
@@ -1652,6 +1691,7 @@ tty_delay_output(void)
while (goal > clock()) {
k = junk; /* Do nothing */
}
nhUse(k);
}
/*
@@ -2044,9 +2084,9 @@ win32con_debug_keystrokes(void)
xputs("\n");
while (!valid || ch != 27) {
nocmov(ttyDisplay->curx, ttyDisplay->cury);
ReadConsoleInput(console.hConIn, &ir, 1, &count);
if ((ir.EventType == KEY_EVENT) && ir.Event.KeyEvent.bKeyDown)
ch = process_keystroke(&ir, &valid, iflags.num_pad, 1);
ReadConsoleInput(console.hConIn, &gbl_ir, 1, &count);
if ((gbl_ir.EventType == KEY_EVENT) && gbl_ir.Event.KeyEvent.bKeyDown)
ch = process_keystroke(&gbl_ir, &valid, iflags.num_pad, 1);
}
(void) doredraw();
}
@@ -2090,7 +2130,7 @@ map_subkeyvalue(char *op)
key_overrides[idx] = val;
}
#if 0
/* fatal error */
/*VARARGS1*/
void consoletty_error
@@ -2109,6 +2149,7 @@ VA_DECL(const char *, s)
VA_END();
exit(EXIT_FAILURE);
}
#endif
void
synch_cursor(void)
@@ -2116,13 +2157,16 @@ synch_cursor(void)
really_move_cursor();
}
#ifndef VIRTUAL_TERMINAL_SEQUENCES
static int CALLBACK EnumFontCallback(
const LOGFONTW * lf, const TEXTMETRICW * tm, DWORD fontType, LPARAM lParam)
const LOGFONTW * lf, const TEXTMETRICW * tm UNUSED,
DWORD fontType UNUSED, LPARAM lParam)
{
LOGFONTW * lf_ptr = (LOGFONTW *) lParam;
*lf_ptr = *lf;
return 0;
}
#endif
/* check_and_set_font ensures that the current font will render the symbols
* that are currently being used correctly. If they will not be rendered
@@ -2147,15 +2191,12 @@ check_and_set_font(void)
#endif
}
#ifndef VIRTUAL_TERMINAL_SEQUENCES
/* check_font_widths returns TRUE if all glyphs in current console font
* fit within the width of a single console cell.
*/
boolean
#ifndef VIRTUAL_TERMINAL_SEQUENCES
check_font_widths(void)
#else /* VIRTUAL_TERMINAL_SEQUENCES */
check_font_widths(void)
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
{
CONSOLE_FONT_INFOEX console_font_info;
console_font_info.cbSize = sizeof(console_font_info);
@@ -2223,7 +2264,7 @@ check_font_widths(void)
int wcUsedCount = 0;
wchar_t wcUsed[256];
for (int i = 0; i < sizeof(used); i++)
for (int i = 0; i < (int) sizeof(used); i++)
if (used[i])
wcUsed[wcUsedCount++] = cp437[i];
@@ -2252,6 +2293,7 @@ clean_up:
return all_glyphs_fit;
}
#endif
/* set_known_good_console_font sets the code page and font used by the console
* to settings know to work well with NetHack. It also saves the original
@@ -2465,7 +2507,7 @@ void nethack_enter_consoletty(void)
{
#ifdef VIRTUAL_TERMINAL_SEQUENCES
char buf[BUFSZ], *bp, *localestr;
BOOL success;
BOOL apisuccess;
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
#if 0
/* set up state needed by early_raw_print() */
@@ -2559,7 +2601,7 @@ void nethack_enter_consoletty(void)
/* store the original font */
console.orig_font_info.cbSize = sizeof(console.orig_font_info);
success = GetCurrentConsoleFontEx(console.hConOut,
apisuccess = GetCurrentConsoleFontEx(console.hConOut,
FALSE, &console.orig_font_info);
console.font_info = console.orig_font_info;
@@ -2576,9 +2618,9 @@ void nethack_enter_consoletty(void)
console.code_page = console.orig_code_page;
if (console.has_unicode) {
if (console.code_page != 437)
success = SetConsoleOutputCP(437);
apisuccess = SetConsoleOutputCP(437);
} else if (console.code_page != 1252) {
success = SetConsoleOutputCP(1252);
apisuccess = SetConsoleOutputCP(1252);
}
console.code_page = GetConsoleOutputCP();
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
@@ -2660,6 +2702,7 @@ void nethack_enter_consoletty(void)
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
console.current_nhcolor = NO_COLOR;
console.is_ready = TRUE;
nhUse(apisuccess);
}
#endif /* TTY_GRAPHICS */
@@ -2718,7 +2761,7 @@ VA_DECL(const char *, fmt)
#ifdef QWERTZ_SUPPORT
/* when 'numberpad' is 0 and Cmd.swap_yz is True
(signaled by setting 0x10 on boolean numpad argument)
(signaled by setting 0x10 on uchar numberpad argument)
treat keypress of numpad 7 as 'z' rather than 'y' */
static boolean qwertz = FALSE;
#endif
@@ -2939,7 +2982,7 @@ set_keyhandling_via_option(void)
int
default_processkeystroke(
HANDLE hConIn,
HANDLE hConIn UNUSED,
INPUT_RECORD *ir,
boolean *valid,
boolean numberpad,
@@ -3104,12 +3147,12 @@ default_kbhit(HANDLE hConIn, INPUT_RECORD *ir)
return retval;
}
int
int
default_checkinput(
HANDLE hConIn,
INPUT_RECORD *ir,
DWORD *count,
boolean numpad,
uchar numberpad,
int mode,
int *mod,
coord *cc)
@@ -3121,8 +3164,8 @@ default_checkinput(
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
if (numpad & 0x10) {
numpad &= ~0x10;
if (numberpad & 0x10) {
numberpad &= ~0x10;
qwertz = TRUE;
} else {
qwertz = FALSE;
@@ -3139,21 +3182,21 @@ default_checkinput(
ReadConsoleInput(hConIn, ir, 1, count);
if (mode == 0) {
if ((ir->EventType == KEY_EVENT) && ir->Event.KeyEvent.bKeyDown) {
ch = default_processkeystroke(hConIn, ir, &valid, numpad, 0);
ch = default_processkeystroke(hConIn, ir, &valid, numberpad, 0);
done = valid;
}
} else {
if (count > 0) {
if (*count > 0) {
if (ir->EventType == KEY_EVENT
&& ir->Event.KeyEvent.bKeyDown) {
#ifdef QWERTZ_SUPPORT
if (qwertz)
numpad |= 0x10;
numberpad |= 0x10;
#endif
ch = default_processkeystroke(hConIn, ir, &valid, numpad, 0);
ch = default_processkeystroke(hConIn, ir, &valid, numberpad, 0);
#ifdef QWERTZ_SUPPORT
numpad &= ~0x10;
#endif
numberpad &= ~0x10;
#endif
if (valid)
return ch;
} else if (ir->EventType == MOUSE_EVENT) {
@@ -3565,7 +3608,7 @@ ray_checkinput(
HANDLE hConIn,
INPUT_RECORD *ir,
DWORD *count,
boolean numpad,
uchar numberpad,
int mode,
int *mod,
coord *cc)
@@ -3577,8 +3620,8 @@ ray_checkinput(
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
if (numpad & 0x10) {
numpad &= ~0x10;
if (numberpad & 0x10) {
numberpad &= ~0x10;
qwertz = TRUE;
} else {
qwertz = FALSE;
@@ -3600,22 +3643,22 @@ ray_checkinput(
ReadConsoleInput(hConIn, ir, 1, count);
} else {
ch = 0;
if (count > 0) {
if (*count > 0) {
if (ir->EventType == KEY_EVENT
&& ir->Event.KeyEvent.bKeyDown) {
#ifdef QWERTZ_SUPPORT
if (qwertz)
numpad |= 0x10;
numberpad |= 0x10;
#endif
ch = ray_processkeystroke(hConIn, ir, &valid, numpad,
ch = ray_processkeystroke(hConIn, ir, &valid, numberpad,
#ifdef PORTDEBUG
1);
#else
0);
#endif
#ifdef QWERTZ_SUPPORT
numpad &= ~0x10;
#endif
numberpad &= ~0x10;
#endif
if (valid)
return ch;
} else {
@@ -3635,7 +3678,7 @@ ray_checkinput(
else if (ir->Event.MouseEvent.dwButtonState
& RIGHTBUTTON)
*mod = CLICK_2;
#if 0 /* middle button */
#if 0 /* middle button */
else if (ir->Event.MouseEvent.dwButtonState & MIDBUTTON)
*mod = CLICK_3;
#endif
@@ -3733,12 +3776,12 @@ ray_kbhit(
* shift values below.
*/
int
int
nh340_processkeystroke(
HANDLE hConIn,
HANDLE hConIn UNUSED,
INPUT_RECORD *ir,
boolean *valid,
boolean numberpad,
uchar numberpad,
int portdebug)
{
int keycode, vk;
@@ -3884,7 +3927,7 @@ nh340_checkinput(
HANDLE hConIn,
INPUT_RECORD *ir,
DWORD *count,
boolean numpad,
uchar numberpad,
int mode,
int *mod,
coord *cc)
@@ -3896,8 +3939,8 @@ nh340_checkinput(
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
if (numpad & 0x10) {
numpad &= ~0x10;
if (numberpad & 0x10) {
numberpad &= ~0x10;
qwertz = TRUE;
} else {
qwertz = FALSE;
@@ -3916,19 +3959,19 @@ nh340_checkinput(
if ((ir->EventType == KEY_EVENT) && ir->Event.KeyEvent.bKeyDown) {
#ifdef QWERTZ_SUPPORT
if (qwertz)
numpad |= 0x10;
numberpad |= 0x10;
#endif
ch = nh340_processkeystroke(hConIn, ir, &valid, numpad, 0);
ch = nh340_processkeystroke(hConIn, ir, &valid, numberpad, 0);
#ifdef QWERTZ_SUPPORT
numpad &= ~0x10;
#endif
numberpad &= ~0x10;
#endif
done = valid;
}
} else {
if (count > 0) {
if (*count > 0) {
if (ir->EventType == KEY_EVENT
&& ir->Event.KeyEvent.bKeyDown) {
ch = nh340_processkeystroke(hConIn, ir, &valid, numpad, 0);
ch = nh340_processkeystroke(hConIn, ir, &valid, numberpad, 0);
if (valid)
return ch;
} else if (ir->EventType == MOUSE_EVENT) {