aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/winpty/misc/Win32Echo2.cc
blob: b2ea2ad1c5d75eb70b587e0f1f0fbe4922ceb51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * A Win32 program that reads raw console input with getch and echos
 * it to stdout.
 */

#include <stdio.h>
#include <conio.h>

int main()
{
    int count = 0;
    while (true) {
        int ch = getch();
        printf("%02x ", ch);
        if (++count == 50)
            break;
    }
    return 0;
}