mirror of https://github.com/minetest/irrlicht.git
Use SDL's API function to check for TextInputActive state
This commit is contained in:
parent
526abaccbe
commit
889890810e
|
@ -224,7 +224,7 @@ void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
|||
// sent as text input events instead of the result) when
|
||||
// SDL_StartTextInput() is called on the same input box.
|
||||
core::rect<s32> pos = elem->getAbsolutePosition();
|
||||
if (!lastElemPos || *lastElemPos != pos)
|
||||
if (!SDL_IsTextInputActive() || lastElemPos != pos)
|
||||
{
|
||||
lastElemPos = pos;
|
||||
SDL_Rect rect;
|
||||
|
@ -238,7 +238,6 @@ void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
|||
}
|
||||
else
|
||||
{
|
||||
lastElemPos.reset();
|
||||
SDL_StopTextInput();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <SDL_syswm.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
@ -304,7 +303,7 @@ namespace irr
|
|||
|
||||
bool Resizable;
|
||||
|
||||
std::optional<core::rect<s32>> lastElemPos;
|
||||
core::rect<s32> lastElemPos;
|
||||
|
||||
struct SKeyMap
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue