mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-04 00:41:34 +00:00
Don't use Activate and Move keys for GUI navigation if bound to mouse buttons (Fixes #4225, Fixes #4320)
This commit is contained in:
parent
2a5a574134
commit
f28024b541
1 changed files with 16 additions and 1 deletions
|
@ -174,10 +174,25 @@ namespace MWInput
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isLeftOrRightButton(int action, ICS::InputControlSystem* ics, int deviceId, bool joystick)
|
||||||
|
{
|
||||||
|
int mouseBinding = ics->getMouseButtonBinding(ics->getControl(action), ICS::Control::INCREASE);
|
||||||
|
if (mouseBinding != ICS_MAX_DEVICE_BUTTONS)
|
||||||
|
return true;
|
||||||
|
int buttonBinding = ics->getJoystickButtonBinding(ics->getControl(action), deviceId, ICS::Control::INCREASE);
|
||||||
|
if (joystick && (buttonBinding == 0 || buttonBinding == 1))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void InputManager::handleGuiArrowKey(int action)
|
void InputManager::handleGuiArrowKey(int action)
|
||||||
{
|
{
|
||||||
if (SDL_IsTextInputActive())
|
if (SDL_IsTextInputActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (isLeftOrRightButton(action, mInputBinder, mFakeDeviceID, mJoystickLastUsed))
|
||||||
|
return;
|
||||||
|
|
||||||
MyGUI::KeyCode key;
|
MyGUI::KeyCode key;
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
@ -1115,7 +1130,7 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
|
||||||
{
|
{
|
||||||
if (!SDL_IsTextInputActive())
|
if (!SDL_IsTextInputActive() && !isLeftOrRightButton(A_Activate, mInputBinder, mFakeDeviceID, mJoystickLastUsed))
|
||||||
MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Return, 0);
|
MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Return, 0);
|
||||||
}
|
}
|
||||||
else if (mControlSwitch["playercontrols"])
|
else if (mControlSwitch["playercontrols"])
|
||||||
|
|
Loading…
Reference in a new issue