summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-03-31 02:58:51 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-03-31 22:17:43 +0200
commitc782dd144f745a9355fac90de386bd8ef1f4cec5 (patch)
treeba9f79dafc9de9f7afcc4d9d47c9d17655dc5deb /crawl-ref/source/libw32c.cc
parentba04275a65160b24d4d3438ea1ff29b82b854013 (diff)
downloadcrawl-ref-c782dd144f745a9355fac90de386bd8ef1f4cec5.tar.gz
crawl-ref-c782dd144f745a9355fac90de386bd8ef1f4cec5.zip
Input on win32 console.
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r--crawl-ref/source/libw32c.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index ff593f3d96..b377178d36 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -641,7 +641,7 @@ static int key_to_command(int keyin)
return keyin;
}
-int vk_translate(WORD VirtCode, CHAR c, DWORD cKeys)
+int vk_translate(WORD VirtCode, WCHAR c, DWORD cKeys)
{
bool shftDown = false;
bool ctrlDown = false;
@@ -773,8 +773,8 @@ int getch_ck(void)
bool waiting_for_event = true;
while (waiting_for_event)
{
- if (ReadConsoleInput(inbuf, &ir, 1, &nread) == 0)
- fputs("Error in ReadConsoleInput()!", stderr);
+ if (ReadConsoleInputW(inbuf, &ir, 1, &nread) == 0)
+ fputs("Error in ReadConsoleInputW()!", stderr);
if (nread > 0)
{
// ignore if it isn't a keyboard event.
@@ -786,7 +786,7 @@ int getch_ck(void)
if (kr->bKeyDown)
{
key = vk_translate(kr->wVirtualKeyCode,
- kr->uChar.AsciiChar,
+ kr->uChar.UnicodeChar,
kr->dwControlKeyState);
if (key > 0)
{
@@ -826,7 +826,7 @@ int kbhit()
{
INPUT_RECORD ir[10];
DWORD read_count = 0;
- PeekConsoleInput(inbuf, ir, sizeof ir / sizeof(ir[0]), &read_count);
+ PeekConsoleInputW(inbuf, ir, sizeof ir / sizeof(ir[0]), &read_count);
if (read_count > 0)
{
for (unsigned i = 0; i < read_count; ++i)