MinecraftConsoles/Minecraft.Client/Common
MrTheShy 05a27edc25 Fix TextInput caret behavior and add proper cursor editing for KBM direct edit
The direct text editing mode introduced for KBM users had several
issues with the TextInput control's caret (blinking cursor) and text
manipulation:

1. Caret visible when not editing:
   When navigating to the world name field with keyboard/mouse, Flash's
   Iggy focus system would show the blinking caret even though the field
   wasn't active for editing yet (Enter not pressed). This was misleading
   since typing had no effect in that state.

   Fix: access the FJ_TextInput's internal m_mcCaret MovieClip and
   force its visibility based on editing state. This is enforced every
   tick because setLabel() and Flash focus transitions continuously
   reset the caret state.

2. No cursor movement during editing:
   The direct edit implementation treated the text as a simple buffer
   with push_back/pop_back — there was no concept of cursor position.
   Backspace only deleted from the end, and arrow keys did nothing.

   Fix: track cursor position (m_iCursorPos) in C++ and use wstring
   insert/erase at that position. Arrow keys (Left/Right), Home, End,
   and Delete now work as expected. The visual caret position is synced
   to Flash via the FJ_TextInput's SetCaretIndex method.

3. setLabel() resetting caret position:
   Every call to setLabel() (when text changes) caused Flash to reset
   the caret to the end of the string, making the cursor jump visually
   even though the C++ position was correct.

   Fix: enforce caret position via setCaretIndex every tick during
   editing, so any Flash-side resets are immediately corrected.

New UIControl_TextInput API:
- setCaretVisible(bool): toggles m_mcCaret.visible in Flash
- setCaretIndex(int): calls FJ_TextInput.SetCaretIndex in Flash
2026-03-05 22:04:34 +01:00
..
Audio Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
Colours Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
DLC Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
DummyTexturePack/res Initial commit 2026-03-01 12:16:08 +08:00
GameRules Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
Leaderboards feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Media Fix DLCs textures and update logo in 720p (#517) 2026-03-05 15:12:50 +07:00
Network Trim newline characters from IP address (#600) 2026-03-05 14:27:08 -06:00
res feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Telemetry Initial commit 2026-03-01 12:16:08 +08:00
Trial Initial commit 2026-03-01 12:16:08 +08:00
Tutorial Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
UI Fix TextInput caret behavior and add proper cursor editing for KBM direct edit 2026-03-05 22:04:34 +01:00
XUI Remove AUTO_VAR macro and _toString function (#592) 2026-03-06 02:11:18 +07:00
zlib Revert "Get rid of MSVC's __int64" 2026-03-02 17:39:35 +07:00
App_Defines.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
App_enums.h shift + click for quickmove (#278) 2026-03-03 23:27:23 +07:00
App_structs.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
BuildVer.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
C4JMemoryPool.h Initial commit 2026-03-01 12:16:08 +08:00
C4JMemoryPoolAllocator.h Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.sln Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.vcxproj Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.vcxproj.filters Initial commit 2026-03-01 12:16:08 +08:00
Console_Awards_enum.h Initial commit 2026-03-01 12:16:08 +08:00
Console_Debug_enum.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Console_Utils.cpp Initial commit 2026-03-01 12:16:08 +08:00
ConsoleGameMode.cpp Optimize Path for Tutorial.h in ConsoleGameMode.cpp 2026-03-01 15:05:24 -07:00
ConsoleGameMode.h Optimize TutorialMode.h Filepath in ConsoleGameMode.h 2026-03-01 15:06:42 -07:00
Consoles_App.cpp Fix gamma slider via pixel shader #178 (#481) 2026-03-06 02:41:17 +07:00
Consoles_App.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Minecraft_Macros.h Initial commit 2026-03-01 12:16:08 +08:00
PostProcesser.h Fix gamma slider via pixel shader #178 (#481) 2026-03-06 02:41:17 +07:00
Potion_Macros.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
xuiscene_base.h Initial commit 2026-03-01 12:16:08 +08:00