Only toggleOnScreenKeyboard false if using it

This commit is contained in:
Benau 2019-06-14 10:40:54 +08:00
parent b7dc5dd6f2
commit acc05bfcef

View File

@ -245,7 +245,9 @@ CGUIEditBox::~CGUIEditBox()
dl->setIMEEnable(false);
}
#endif
irr_driver->getDevice()->toggleOnScreenKeyboard(false);
if (GUIEngine::ScreenKeyboard::shouldUseScreenKeyboard() &&
irr_driver->getDevice()->hasOnScreenKeyboard())
irr_driver->getDevice()->toggleOnScreenKeyboard(false);
#endif
}
@ -675,7 +677,9 @@ bool CGUIEditBox::processKey(const SEvent& event)
break;
case IRR_KEY_RETURN:
{
irr_driver->getDevice()->toggleOnScreenKeyboard(false);
if (GUIEngine::ScreenKeyboard::shouldUseScreenKeyboard() &&
irr_driver->getDevice()->hasOnScreenKeyboard())
irr_driver->getDevice()->toggleOnScreenKeyboard(false);
sendGuiEvent( EGET_EDITBOX_ENTER );
}
break;