From 5ef159a9717aaf624c4927e76fcd083e94b5d7b9 Mon Sep 17 00:00:00 2001 From: ayuanx Date: Sun, 29 Nov 2009 17:58:52 +0000 Subject: Now WiiMote button mapping supports both Keyboard & Joypad, or even mixed, no need to bother Xpadder. :) But I've only tested on Win32 SDL, don't know about Linux or 360pad. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4630 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/InputCommon/Src/Configuration.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon/Src/Configuration.cpp') diff --git a/Source/Core/InputCommon/Src/Configuration.cpp b/Source/Core/InputCommon/Src/Configuration.cpp index f7f25d2cfe..393a9e876a 100644 --- a/Source/Core/InputCommon/Src/Configuration.cpp +++ b/Source/Core/InputCommon/Src/Configuration.cpp @@ -160,7 +160,7 @@ void RadiusAdjustment(int &_x, int &_y, int _pad, std::string SRadius) // --------------------- /* Calculate the distance from the outer edges of the box to the outer edges of the circle inside the box - at any angle from 0° to 360°. The returned value is 1 + Distance, for example at most sqrt(2) in the + at any angle from 0 to 360. The returned value is 1 + Distance, for example at most sqrt(2) in the corners and at least 1.0 at the horizontal and vertical angles. */ float Square2CircleDistance(float deg) { @@ -240,9 +240,13 @@ std::string VKToString(int keycode) #ifdef _WIN32 // Default value char KeyStr[64] = {0}; + std::string KeyString; + // TODO: Switch to unicode GetKeyNameText? - GetKeyNameTextA(MapVirtualKey(keycode, MAPVK_VK_TO_VSC) << 16, KeyStr, 64); - std::string KeyString = KeyStr; + if (keycode < 256) // Keyboard + GetKeyNameTextA(MapVirtualKey(keycode, MAPVK_VK_TO_VSC) << 16, KeyStr, 64); + else // Pad + sprintf(KeyStr, "PAD: %d", keycode - 0x1000); switch(keycode) { @@ -263,7 +267,7 @@ std::string VKToString(int keycode) case VK_RCONTROL: return "RIGHT CTRL"; case VK_LMENU: return "LEFT ALT"; - default: return KeyString; + default: return KeyString = KeyStr; } #else // An equivalent name translation can probably be used on other systems to? -- cgit v1.2.3