blob: e896ac9f083e3225153daa16be28bb1b7b2c2fdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/* Stores the old console mode when echo is turned off */
ulint os_old_console_mode;
/********************************************************************
Turns off echo from console input. */
void
os_console_echo_off(void)
/*=====================*/
{
GetConsoleMode(stdio, &os_old_console_mode);
SetConsoleMode(stdio, ENABLE_PROCESSED_INPUT);
}
/********************************************************************
Turns on echo in console input. */
void
os_console_echo_on(void)
/*====================*/
{
SetConsoleMode(stdio, &os_old_console_mode);
}
/********************************************************************
Reads a character from the console. */
char
os_read_console(void)
/*=================*/
{
char input_char;
ulint n_chars;
n_chars = 0;
while (n_chars == 0) {
ReadConsole(stdio, &input_char, 1, &n_chars, NULL);
}
return(input_char);
}
|