Use mouse release instead of press for binding actions

Resolves difficulties binding actions to mouse buttons (Fixes #1364)
deque
scrawl 11 years ago
parent 50a72ed710
commit afc1fa49f6

@ -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

Loading…
Cancel
Save