Merge branch 'Fix-2617'

This commit is contained in:
hiker 2017-08-09 21:21:03 +10:00
commit 626f540b15
3 changed files with 9 additions and 3 deletions

View File

@ -488,11 +488,13 @@ void InputManager::inputSensing(Input::InputType type, int deviceID,
// We have to save the direction in which the axis was moved.
// This is done by storing it as a sign (and since button can
// be zero, we add one before changing the sign).
int input_id = value>=0 ? 1+button : -(1+button);
int input_button_id = value>=0 ? 1+button : -(1+button);
std::tuple<int, int> input_id(deviceID, input_button_id);
std::tuple<int, int> input_id_inv(deviceID, -input_button_id);
bool id_was_high = m_sensed_input_high_gamepad.find(input_id)
!= m_sensed_input_high_gamepad.end();
bool inverse_id_was_high = m_sensed_input_high_gamepad.find(-input_id)
bool inverse_id_was_high = m_sensed_input_high_gamepad.find(input_id_inv)
!= m_sensed_input_high_gamepad.end();
bool id_was_zero = m_sensed_input_zero_gamepad.find(button)
!= m_sensed_input_zero_gamepad.end();

View File

@ -53,7 +53,7 @@ public:
private:
DeviceManager *m_device_manager;
std::set<int> m_sensed_input_high_gamepad;
std::set<std::tuple<int, int>> m_sensed_input_high_gamepad;
std::set<int> m_sensed_input_high_kbd;
std::set<int> m_sensed_input_zero_gamepad;

View File

@ -434,6 +434,10 @@ void OptionsScreenDevice::gotSensedInput(const Input& sensed_input)
// refresh display
updateInputButtons();
}
else
{
return;
}
}
else if (sensed_input.m_type == Input::IT_NONE)
{