How do you map from a key press to a localized character?
Alternatively (and I suspect overkill for my stage in feature development) - does anyone have any insight on how to implement a ITextInputMethodContext? It looks like this class is meant to interact with the native text editing system but implementation details as thin on the ground.
Spent a few hours with ITextInputMethodContext. Have something that gets a few callbacks from the OS but can’t really get it working.
Guess I’ll try getting Slate input boxes to work within my UI, but that seems like a potential world of pain also!
The standard input system looks good for common English characters but not other languages (judging by FGenericPlatformMisc::GetStandardPrintableKeyMap and EKeys).
Luckily in my current use case the text entry boxes will be topmost so there’s some chance I can use slate but feels like there should be an easier approach to just getting the keys typed as entered with OS language specifics included!
So - followed Rama’s tutorial and got myself an SEditableText widget without rendering that my UI code links to.
Still working out how to get the caret position to render a cursor, and likely issues with mouse selection but the approach has promise.
Edit: Biggest issue I have right now is drawing the caret location. If only SEditableText::SetCaretPosition were virtual…
Edit 2 Hacked around the caret location issue. Creating a derived SEditableText widget to override MoveCursor and JumpTo allowed me to track the caret at my end. No idea how to catch the mouse so I force the caret to the end on mouse click (a fortuitous accident of my wrapper code).
Biggest issue now is that Tab key presses are consumed by the edit box when it has focus which means my UI can’t see them.
Bigger issue - MoveCurser and GetMoveDirection are not avialable in editor builds!
Module.MM_04.3_of_4.cpp.obj : error LNK2019: unresolved external symbol "public: enum ECursorAction __cdecl FMoveCursor::GetAction(void)const " (?GetAction@FMoveCursor@@QEBA?AW4ECursorAction@@XZ) referenced in function “public: virtual class FReply __cdecl SMyEditableText::MoveCursor(class FMoveCursor)” (?MoveCursor@SMyEditableText@@UEAA?AVFReply@@VFMoveCursor@@@Z)
2>Module.MM_04.3_of_4.cpp.obj : error LNK2019: unresolved external symbol "public: struct FIntPoint __cdecl FMoveCursor::GetMoveDirection(void)const " (?GetMoveDirection@FMoveCursor@@QEBA?AUFIntPoint@@XZ) referenced in function “public: virtual class FReply __cdecl SMyEditableText::MoveCursor(class FMoveCursor)” (?MoveCursor@SMyEditableText@@UEAA?AVFReply@@VFMoveCursor@@@Z)