summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Android/ButtonManager.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-02-24 06:25:10 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2015-02-24 06:25:10 -0600
commit7d5a558f31ee8eca26b2b5ee4775f07ffdb8b8bc (patch)
treeee3c9ccfd8a89bea2fbf8d32bbca7df5909d7a4b /Source/Core/DolphinWX/Android/ButtonManager.cpp
parent4e5d115bf0fcff7e78b93868adb38a6726b1ee3e (diff)
parent29fc52cfa17dcc7327c1a081918721cd7cfcf40b (diff)
Merge pull request #2105 from Sonicadvance1/android_stop_eating_buttons
[Android] Stop eating button events we don't handle.
Diffstat (limited to 'Source/Core/DolphinWX/Android/ButtonManager.cpp')
-rw-r--r--Source/Core/DolphinWX/Android/ButtonManager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/Core/DolphinWX/Android/ButtonManager.cpp b/Source/Core/DolphinWX/Android/ButtonManager.cpp
index 7b1004415f..53e64513ba 100644
--- a/Source/Core/DolphinWX/Android/ButtonManager.cpp
+++ b/Source/Core/DolphinWX/Android/ButtonManager.cpp
@@ -156,16 +156,14 @@ namespace ButtonManager
}
return value;
}
- void GamepadEvent(std::string dev, int button, int action)
+ bool GamepadEvent(std::string dev, int button, int action)
{
auto it = m_controllers.find(dev);
if (it != m_controllers.end())
- {
- it->second->PressEvent(button, action);
- return;
- }
+ return it->second->PressEvent(button, action);
+
m_controllers[dev] = new InputDevice(dev);
- m_controllers[dev]->PressEvent(button, action);
+ return m_controllers[dev]->PressEvent(button, action);
}
void GamepadAxisEvent(std::string dev, int axis, float value)
{
@@ -186,8 +184,9 @@ namespace ButtonManager
}
// InputDevice
- void InputDevice::PressEvent(int button, int action)
+ bool InputDevice::PressEvent(int button, int action)
{
+ bool handled = false;
for (const auto& binding : _inputbinds)
{
if (binding.second->_bind == button)
@@ -196,8 +195,10 @@ namespace ButtonManager
_buttons[binding.second->_buttontype] = action == BUTTON_PRESSED ? true : false;
else
_axises[binding.second->_buttontype] = action == BUTTON_PRESSED ? 1.0f : 0.0f;
+ handled = true;
}
}
+ return handled;
}
void InputDevice::AxisEvent(int axis, float value)
{