mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Fixed thumbstick not releasing properly in GUI mode. I forgot to inject key release
This commit is contained in:
parent
f7ceee7a5e
commit
6c0a02d2c3
1 changed files with 29 additions and 1 deletions
|
@ -647,6 +647,7 @@ namespace MWVR
|
|||
if (guiMode)
|
||||
{
|
||||
MyGUI::KeyCode key = MyGUI::KeyCode::None;
|
||||
bool onPress = true;
|
||||
|
||||
// Axis actions
|
||||
switch (action->openMWActionCode())
|
||||
|
@ -660,6 +661,16 @@ namespace MWVR
|
|||
{
|
||||
key = MyGUI::KeyCode::ArrowLeft;
|
||||
}
|
||||
if (action->value() < 0.6f && action->previousValue() > 0.6f)
|
||||
{
|
||||
key = MyGUI::KeyCode::ArrowRight;
|
||||
onPress = false;
|
||||
}
|
||||
if (action->value() > -0.6f && action->previousValue() < -0.6f)
|
||||
{
|
||||
key = MyGUI::KeyCode::ArrowLeft;
|
||||
onPress = false;
|
||||
}
|
||||
break;
|
||||
case A_MenuUpDown:
|
||||
if (action->value() > 0.6f && action->previousValue() < 0.6f)
|
||||
|
@ -670,6 +681,16 @@ namespace MWVR
|
|||
{
|
||||
key = MyGUI::KeyCode::ArrowDown;
|
||||
}
|
||||
if (action->value() < 0.6f && action->previousValue() > 0.6f)
|
||||
{
|
||||
key = MyGUI::KeyCode::ArrowUp;
|
||||
onPress = false;
|
||||
}
|
||||
if (action->value() > -0.6f && action->previousValue() < -0.6f)
|
||||
{
|
||||
key = MyGUI::KeyCode::ArrowDown;
|
||||
onPress = false;
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
@ -720,9 +741,16 @@ namespace MWVR
|
|||
}
|
||||
|
||||
if (key != MyGUI::KeyCode::None)
|
||||
{
|
||||
if (onPress)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->injectKeyPress(key, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->injectKeyRelease(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue