forked from Mirrorlandia_minetest/irrlicht
master #5
@ -218,10 +218,29 @@ int CIrrDeviceSDL::findCharToPassToIrrlicht(int assumedChar, EKEY_CODE key) {
|
|||||||
void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
||||||
gui::IGUIElement *elem = GUIEnvironment->getFocus();
|
gui::IGUIElement *elem = GUIEnvironment->getFocus();
|
||||||
if (elem && elem->acceptsIME())
|
if (elem && elem->acceptsIME())
|
||||||
|
{
|
||||||
|
// IBus seems to have an issue where dead keys and compose keys do not
|
||||||
|
// work (specifically, the individual characters in the sequence are
|
||||||
|
// 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 (!SDL_IsTextInputActive() || lastElemPos != pos)
|
||||||
|
{
|
||||||
|
lastElemPos = pos;
|
||||||
|
SDL_Rect rect;
|
||||||
|
rect.x = pos.UpperLeftCorner.X;
|
||||||
|
rect.y = pos.UpperLeftCorner.Y;
|
||||||
|
rect.w = pos.getWidth();
|
||||||
|
rect.h = pos.getHeight();
|
||||||
|
SDL_SetTextInputRect(&rect);
|
||||||
SDL_StartTextInput();
|
SDL_StartTextInput();
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//! constructor
|
//! constructor
|
||||||
CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
||||||
|
@ -303,6 +303,8 @@ namespace irr
|
|||||||
|
|
||||||
bool Resizable;
|
bool Resizable;
|
||||||
|
|
||||||
|
core::rect<s32> lastElemPos;
|
||||||
|
|
||||||
struct SKeyMap
|
struct SKeyMap
|
||||||
{
|
{
|
||||||
SKeyMap() {}
|
SKeyMap() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user