summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2010-10-19 23:11:22 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2010-10-19 23:11:22 +0000
commit7b45ac6e01fd6b817cec19a277241888a60e50dc (patch)
tree9a1bd477ca0848130ef6a3d26c7116f05a3697c3 /Source/Core/InputCommon/Src/ControllerInterface
parentcf05cca7a69a1c61f60e781700642111150d5d4b (diff)
Made it easer to use mouse/keyboard and a gamepad together on the same emulated wiimote. Renamed mouse buttons from "Button N" to "Click N" so they do not conflict with gamepad buttons.(hopefully not too ugly, mouse buttons will need to be reconfigured) (Fixes issue 3363)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6289 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp23
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp2
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXMouse.mm2
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp2
4 files changed, 26 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
index e29c9d53e3..69e340d4f5 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.cpp
@@ -419,6 +419,29 @@ void ControllerInterface::UpdateReference(ControllerInterface::ControlReference*
devc.control = *i;
ref->m_controls.push_back(devc);
}
+ else
+ {
+ // the input wasn't found, look through all the other devices
+
+ std::vector<Device*>::const_iterator
+ deviter = m_devices.begin(),
+ devend = m_devices.end();
+
+ for(; deviter != devend; ++deviter)
+ {
+ for(i = (*deviter)->Inputs().begin(); i < (*deviter)->Inputs().end(); ++i)
+ if(*(*i) == ctrl_str)
+ break;
+
+ if ((*deviter)->Inputs().end() != i)
+ {
+ devc.device = *deviter;
+ devc.control = *i;
+ ref->m_controls.push_back(devc);
+ break;
+ }
+ }
+ }
}
else
{
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index 1cd925c992..69ffcf6e75 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -262,7 +262,7 @@ std::string KeyboardMouse::Key::GetName() const
std::string KeyboardMouse::Button::GetName() const
{
- return std::string("Button ") + char('0' + m_index);
+ return std::string("Click ") + char('0' + m_index);
}
std::string KeyboardMouse::Axis::GetName() const
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXMouse.mm b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXMouse.mm
index e55533aeba..b853d3b992 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXMouse.mm
+++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXMouse.mm
@@ -115,7 +115,7 @@ Mouse::Button::Button(IOHIDElementRef element)
{
std::ostringstream s;
s << IOHIDElementGetUsage(m_element);
- m_name = std::string("Button ") + s.str();
+ m_name = std::string("Click ") + s.str();
}
ControlState Mouse::Button::GetState(IOHIDDeviceRef device) const
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
index f1dcbaa79a..f9e05fbbab 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
+++ b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp
@@ -162,7 +162,7 @@ std::string KeyboardMouse::Button::GetName() const
case Button5Mask: button = '5'; break;
}
- static char tmpstr[] = "Button .";
+ static char tmpstr[] = "Click .";
tmpstr[7] = button;
return tmpstr;
}