summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorayuanx <ayuanx@gmail.com>2009-11-29 17:58:52 +0000
committerayuanx <ayuanx@gmail.com>2009-11-29 17:58:52 +0000
commit5ef159a9717aaf624c4927e76fcd083e94b5d7b9 (patch)
tree8beed69a03f667f2c2f4c22a9219f38f29826f46 /Source/Core
parent8eb821722f0d296778f6550665f322adf91cb042 (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/InputCommon/Src/Configuration.cpp12
-rw-r--r--Source/Core/InputCommon/Src/SDL.cpp3
2 files changed, 10 insertions, 5 deletions
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?
diff --git a/Source/Core/InputCommon/Src/SDL.cpp b/Source/Core/InputCommon/Src/SDL.cpp
index 0caf01ccd3..f6b1d9ee25 100644
--- a/Source/Core/InputCommon/Src/SDL.cpp
+++ b/Source/Core/InputCommon/Src/SDL.cpp
@@ -293,7 +293,8 @@ void GetButton(SDL_Joystick *joy, int ControllerID, int buttons, int axes, int h
{
for(int i = 0; i < hats; i++)
{
- if(SDL_JoystickGetHat(joy, i))
+ value = SDL_JoystickGetHat(joy, i);
+ if(value)
{
pressed = i;
type = InputCommon::CTL_HAT;