How to enable IME for entering Chinese, Japanese, and Korean text input?

Support for using Input Method Editor (IME) to enter Chinese, Japanese, and Korean text varies by 3D WebView package. Please see the following sections for a description of each package's IME support:

3D WebView for Windows and macOS

Starting in v4.6, 3D WebView for Windows and macOS supports IME for entering Chinese, Japanese, and Korean text input using the computer's physical hardware keyboard. IME support is automatically enabled for a WebViewPrefab or CanvasWebViewPrefab if its KeyboardEnabled option is enabled. An application can also manually implement IME for an IWebView using the IWithIme interface, however that's not necessary when using WebViewPrefab or CanvasWebViewPrefab. If you find that IME is not working on Windows and macOS, it is likely because your project is using a version of 3D WebView older than v4.6. In that case, please upgrade to the latest release, and that should resolve the issue. Also, on macOS specifically, IME support has the following Unity version requirements:

  • Unity 2021.2 or newer
  • Or a version of Unity 2020.3 newer than 2020.3.38

Please note that 3D WebView's on-screen Keyboard and CanvasKeyboard prefabs do not support IME and do not support Chinese, Japanese, or Korean. If you need an on-screen keyboard in your app that supports Chinese, Japanese, or Korean, please see this section that describes how to enter characters for those languages programmatically.

Android, iOS, UWP, and WebGL

The following packages support IME for entering Chinese, Japanese, and Korean text input when Native 2D Mode is enabled:

However, these packages do not support IME when running in the default 3D rendering mode (i.e. when Native 2D Mode is disabled). If you're unable to use Native 2D Mode for your use case, please the section below that describes how to enter Chinese, Japanese, and Korean when IME isn't supported.

3D WebView for Android with Gecko Engine

3D WebView for Android with Gecko Engine does not support IME. Please see the section below that describes how to enter Chinese, Japanese, and Korean when IME isn't supported.

Entering Chinese, Japanese, and Korean when IME isn't supported

Keyboard input can be sent to a webview via the IWebView.SendKey() method like described in this article. An application can pass Chinese, Japanese, and Korean characters to SendKey() like this:

webViewPrefab.WebView.SendKey("猫");

So, if your application is using a 3D WebView package or configuration that doesn't support IME, a workaround could be for the application to implement an IME-enabled text input field where the user can compose text, and then when the user is finished, the application can call IWebView.SendKey() to send each character to the webview.