mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 03:15:32 +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)
|
||||
{
|
||||
if (SDL_IsTextInputActive())
|
||||
return;
|
||||
|
||||
if (isLeftOrRightButton(action, mInputBinder, mFakeDeviceID, mJoystickLastUsed))
|
||||
return;
|
||||
|
||||
MyGUI::KeyCode key;
|
||||
switch (action)
|
||||
{
|
||||
|
@ -1115,7 +1130,7 @@ namespace MWInput
|
|||
{
|
||||
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);
|
||||
}
|
||||
else if (mControlSwitch["playercontrols"])
|
||||
|
|
Loading…
Reference in a new issue