diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-10-10 13:42:00 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-10-10 13:42:00 +0400 |
commit | f818494c6372b5d0184ec4065876b065c6b34bfe (patch) | |
tree | 566be84ad0ceb79611f4cdd8f5a452d778b18a5c /winsup/utils/cygcheck.cc | |
parent | 336e8ee6852b3c3aa9e2dc6e83d8d156c017481e (diff) |
* cygcheck.cc (check_keys): Use UNICODE Win32 functions.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r-- | winsup/utils/cygcheck.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 0c56bbd75..a05a8467d 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -1958,7 +1958,7 @@ dump_sysinfo () static int check_keys () { - HANDLE h = CreateFileA ("CONIN$", GENERIC_READ | GENERIC_WRITE, + HANDLE h = CreateFileW (L"CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -1984,14 +1984,14 @@ check_keys () INPUT_RECORD in, prev_in; // Drop first <RETURN> key - ReadConsoleInput (h, &in, 1, &mode); + ReadConsoleInputW (h, &in, 1, &mode); memset (&in, 0, sizeof in); do { prev_in = in; - if (!ReadConsoleInput (h, &in, 1, &mode)) + if (!ReadConsoleInputW (h, &in, 1, &mode)) display_error ("check_keys: ReadConsoleInput()"); if (!memcmp (&in, &prev_in, sizeof in)) @@ -2000,12 +2000,12 @@ check_keys () switch (in.EventType) { case KEY_EVENT: - printf ("%s %ux VK: 0x%02x VS: 0x%02x A: 0x%02x CTRL: ", + printf ("%s %ux VK: 0x%04x VS: 0x%04x C: 0x%04x CTRL: ", in.Event.KeyEvent.bKeyDown ? "Pressed " : "Released", in.Event.KeyEvent.wRepeatCount, in.Event.KeyEvent.wVirtualKeyCode, in.Event.KeyEvent.wVirtualScanCode, - (unsigned char) in.Event.KeyEvent.uChar.AsciiChar); + (unsigned char) in.Event.KeyEvent.uChar.UnicodeChar); fputs (in.Event.KeyEvent.dwControlKeyState & CAPSLOCK_ON ? "CL " : "-- ", stdout); fputs (in.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY ? @@ -2033,7 +2033,7 @@ check_keys () } while (in.EventType != KEY_EVENT || in.Event.KeyEvent.bKeyDown != FALSE || - in.Event.KeyEvent.uChar.AsciiChar != 'q'); + in.Event.KeyEvent.uChar.UnicodeChar != L'q'); CloseHandle (h); return 0; |