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
|
// sent as text input events instead of the result) when
|
||||||
// SDL_StartTextInput() is called on the same input box.
|
// SDL_StartTextInput() is called on the same input box.
|
||||||
core::rect<s32> pos = elem->getAbsolutePosition();
|
core::rect<s32> pos = elem->getAbsolutePosition();
|
||||||
if (!lastElemPos || *lastElemPos != pos)
|
if (!SDL_IsTextInputActive() || lastElemPos != pos)
|
||||||
{
|
{
|
||||||
lastElemPos = pos;
|
lastElemPos = pos;
|
||||||
SDL_Rect rect;
|
SDL_Rect rect;
|
||||||
|
@ -238,7 +238,6 @@ void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lastElemPos.reset();
|
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
@ -304,7 +303,7 @@ namespace irr
|
||||||
|
|
||||||
bool Resizable;
|
bool Resizable;
|
||||||
|
|
||||||
std::optional<core::rect<s32>> lastElemPos;
|
core::rect<s32> lastElemPos;
|
||||||
|
|
||||||
struct SKeyMap
|
struct SKeyMap
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue