mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
* cygcheck.cc (check_keys): Use UNICODE Win32 functions.
This commit is contained in:
parent
336e8ee685
commit
f818494c63
@ -1,3 +1,7 @@
|
|||||||
|
2011-10-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygcheck.cc (check_keys): Use UNICODE Win32 functions.
|
||||||
|
|
||||||
2011-09-12 Jon TURNEY <jon.turney@dronecode.org.uk>
|
2011-09-12 Jon TURNEY <jon.turney@dronecode.org.uk>
|
||||||
|
|
||||||
* strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESS
|
* strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESS
|
||||||
|
@ -1958,7 +1958,7 @@ dump_sysinfo ()
|
|||||||
static int
|
static int
|
||||||
check_keys ()
|
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,
|
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
@ -1984,14 +1984,14 @@ check_keys ()
|
|||||||
INPUT_RECORD in, prev_in;
|
INPUT_RECORD in, prev_in;
|
||||||
|
|
||||||
// Drop first <RETURN> key
|
// Drop first <RETURN> key
|
||||||
ReadConsoleInput (h, &in, 1, &mode);
|
ReadConsoleInputW (h, &in, 1, &mode);
|
||||||
|
|
||||||
memset (&in, 0, sizeof in);
|
memset (&in, 0, sizeof in);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
prev_in = in;
|
prev_in = in;
|
||||||
if (!ReadConsoleInput (h, &in, 1, &mode))
|
if (!ReadConsoleInputW (h, &in, 1, &mode))
|
||||||
display_error ("check_keys: ReadConsoleInput()");
|
display_error ("check_keys: ReadConsoleInput()");
|
||||||
|
|
||||||
if (!memcmp (&in, &prev_in, sizeof in))
|
if (!memcmp (&in, &prev_in, sizeof in))
|
||||||
@ -2000,12 +2000,12 @@ check_keys ()
|
|||||||
switch (in.EventType)
|
switch (in.EventType)
|
||||||
{
|
{
|
||||||
case KEY_EVENT:
|
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.bKeyDown ? "Pressed " : "Released",
|
||||||
in.Event.KeyEvent.wRepeatCount,
|
in.Event.KeyEvent.wRepeatCount,
|
||||||
in.Event.KeyEvent.wVirtualKeyCode,
|
in.Event.KeyEvent.wVirtualKeyCode,
|
||||||
in.Event.KeyEvent.wVirtualScanCode,
|
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 ?
|
fputs (in.Event.KeyEvent.dwControlKeyState & CAPSLOCK_ON ?
|
||||||
"CL " : "-- ", stdout);
|
"CL " : "-- ", stdout);
|
||||||
fputs (in.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY ?
|
fputs (in.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY ?
|
||||||
@ -2033,7 +2033,7 @@ check_keys ()
|
|||||||
}
|
}
|
||||||
while (in.EventType != KEY_EVENT ||
|
while (in.EventType != KEY_EVENT ||
|
||||||
in.Event.KeyEvent.bKeyDown != FALSE ||
|
in.Event.KeyEvent.bKeyDown != FALSE ||
|
||||||
in.Event.KeyEvent.uChar.AsciiChar != 'q');
|
in.Event.KeyEvent.uChar.UnicodeChar != L'q');
|
||||||
|
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user