From 37b63f8a0ca0e4c13f362da4f82f9311b84df801 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sun, 2 Aug 2009 18:46:39 +0000 Subject: [PATCH] Zeropad/Win32: Make what appears to be a fairly significant bugfix, for what it's worth. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1596 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zeropad/keyboard.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/zeropad/keyboard.cpp b/plugins/zeropad/keyboard.cpp index 855bf89a1b..2384b927a1 100644 --- a/plugins/zeropad/keyboard.cpp +++ b/plugins/zeropad/keyboard.cpp @@ -31,16 +31,20 @@ return -1; } +#ifdef _WINDOWS_ +WORD toCharTemp; +#endif + char* KeysymToChar(int keysym) { - #ifdef __LINUX__ +#ifdef __LINUX__ return XKeysymToString(keysym); #else - LPWORD temp; - - ToAscii((UINT) keysym, NULL, NULL, temp, NULL); - return (char*)temp; - #endif + // fixed this to return *valid* results, and not some pointer + // to the fourth oblivion-- air + ToAscii((UINT) keysym, NULL, NULL, &toCharTemp, NULL); + return (char*)(&toCharTemp); +#endif } void PollForKeyboardInput(int pad)