1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Use mouse release instead of press for binding actions

Resolves difficulties binding actions to mouse buttons (Fixes #1364)
This commit is contained in:
scrawl 2014-05-29 20:35:57 +02:00
parent 50a72ed710
commit afc1fa49f6

View file

@ -333,17 +333,14 @@ namespace ICS
} }
} }
} }
else if(mDetectingBindingListener)
{
mDetectingBindingListener->mouseButtonBindingDetected(this,
mDetectingBindingControl, btn, mDetectingBindingDirection);
}
} }
} }
void InputControlSystem::mouseReleased(const SDL_MouseButtonEvent &evt, Uint8 btn) void InputControlSystem::mouseReleased(const SDL_MouseButtonEvent &evt, Uint8 btn)
{ {
if(mActive) if(mActive)
{
if (!mDetectingBindingControl)
{ {
ControlsButtonBinderMapType::const_iterator it = mControlsMouseButtonBinderMap.find((int)btn); ControlsButtonBinderMapType::const_iterator it = mControlsMouseButtonBinderMap.find((int)btn);
if(it != mControlsMouseButtonBinderMap.end()) if(it != mControlsMouseButtonBinderMap.end())
@ -351,6 +348,12 @@ namespace ICS
it->second.control->setChangingDirection(Control::STOP); it->second.control->setChangingDirection(Control::STOP);
} }
} }
else if(mDetectingBindingListener)
{
mDetectingBindingListener->mouseButtonBindingDetected(this,
mDetectingBindingControl, btn, mDetectingBindingDirection);
}
}
} }
// mouse auto bindings // mouse auto bindings