From 36a5015bc009da25821705a959fac4301295b01a Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 27 Jan 2010 02:39:59 +0000 Subject: [PATCH] Make arrow and home keys work in wiimote emulator. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4967 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/InputCommon/Src/X11InputBase.cpp | 3 +++ Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp | 1 + Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/InputCommon/Src/X11InputBase.cpp b/Source/Core/InputCommon/Src/X11InputBase.cpp index f9ffd168db..914caeafe5 100644 --- a/Source/Core/InputCommon/Src/X11InputBase.cpp +++ b/Source/Core/InputCommon/Src/X11InputBase.cpp @@ -121,6 +121,9 @@ KeySym wxCharCodeWXToX(int id) void XKeyToString(unsigned int keycode, char *keyStr) { switch (keycode) { + case XK_Home: + sprintf(keyStr, "HOME"); + break; case XK_Left: sprintf(keyStr, "LEFT"); break; diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp index 7331c95de2..f074da6b40 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuMain.cpp @@ -741,6 +741,7 @@ void ReadLinuxKeyboard() XGetWindowAttributes (E.xmotion.display, E.xmotion.window, &WinAttribs); MousePos.WinWidth = WinAttribs.width; MousePos.WinHeight = WinAttribs.height; + break; } default: break; diff --git a/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp b/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp index b294ee495f..1cb1d1d87a 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/FillReport.cpp @@ -303,11 +303,13 @@ bool IsKey(int Key) { int MapKey = WiiMapping[g_ID].Button[Key]; +#ifdef _WIN32 if (MapKey < 256) { -#ifdef _WIN32 Ret = GetAsyncKeyState(MapKey); // Keyboard (Windows) #else + if (MapKey < 256 || (MapKey >= 0xff50 && MapKey <= 0xff54)) + { Ret = KeyStatus[Key]; // Keyboard (Linux) #endif }