Skip to content

Commit

Permalink
Implement IME input support
Browse files Browse the repository at this point in the history
Refactor TextBox control to handle IME composition with inline preview and input panels at cursor.
Toggle IME composition mode only when player enters or exits input UIs. IME must remain disabled during gameplay.
Standard non-IME text input should remain unchanged and behave the same as before. The IME pathway is only activated when user has a suitable provider installed to OS and has enabled IME typing.
Still requires some testing and no doubt bugfix before this is ready for live builds.
  • Loading branch information
Interkarma committed Oct 3, 2023
1 parent 94d9ec6 commit f760f1f
Show file tree
Hide file tree
Showing 6 changed files with 279 additions and 123 deletions.
6 changes: 3 additions & 3 deletions Assets/Scripts/Game/DaggerfallUI.cs
Expand Up @@ -392,6 +392,9 @@ void Start()
pixelFontMaterial.EnableKeyword(KeyWords.MacOSX);
sdfFontMaterial.EnableKeyword(KeyWords.MacOSX);
}

// Reset IME composition mode to default at startup
Input.imeCompositionMode = IMECompositionMode.Auto;
}

void Update()
Expand Down Expand Up @@ -452,9 +455,6 @@ void OnGUI()

if (Event.current.keyCode != KeyCode.None)
lastKeyCode = Event.current.keyCode;

if (lastCharacterTyped > 255)
lastCharacterTyped = (char)0;
}

if (processHotkeys)
Expand Down

0 comments on commit f760f1f

Please sign in to comment.