Korean input lag on Macos

On Macos system, we found that when using the Korean input method, the text input box in Unreal will lag behind for a long time when displaying the typed characters. The screen record shows the issue clearly. It is happened in unreal editor and packaged unreal game. But it is fine on non-unreal app. What is the possible reason and is there any way to fix this issue?

Steps to Reproduce
Hardware: MacBook Pro 36GB memory

Chip: Apple M4 Max

OS: Sequoia Version 15.5

Reproduce steps:

  • Launch unreal editor on Mac
  • Open `Editor Preferences` window
  • Switch current keyboard input source to `2- Set Korean`
  • Quick tap the keyboard and input characters in the top search input box.
  • The input will lag for a long time, wait a long time after stop tapping, the characters would show in the editbox slowly.

The issue also happened in editbox of games on mac book

Hi,

Thanks for reporting this issue. I’m able to reproduce it on my M3 Max as well, but I couldn’t on Windows.

I don’t have a quick solution to fix this but I will investigate and come back with an update asap.

Regards,

Hugo Lamarche

Hi again,

After some investigation, I found that marked text is processed differently to allow text to be composed with IMEs for languages like Chinese, Japanese and Korean.

Instead of being handled by Slate and displayed immediately, we use FCocoaTextView to process it using the native mechanism available in macOS framework.

I don’t know why this is specifically slow, but it’s not a rendering issue, and it could be related to some delay before finalizing the text entry.

Regards,

Hugo Lamarche

Hi,

I have a definitive answer on what is causing ​the slowness when typing with languages that require IMEs (Input Method Editor).

One of the main differences between the macOS platform and Windows & Linux is that we separate the MainThread from the GameThread.

This separation exists because when an app becomes unresponsive (no longer processing events from the OS) on macOS, macOS might kill it, whereas on Windows & Linux, it’s not a problem.

So, Slate (our UI framework) lives on GameThread, while we make any calls that touch the macOS framework on MainThread.

To support the IME feature, we implement the protocol NSTextInputClient, which needs to be executed on MainThread, but any calls that might involve Slate need to move back to GameThread.

Usually, the back-and-forth between the two threads is not noticeable, but in the case of IME, I’ve seen it more than 30 times for a single keystroke.

​This is what’s causing the slowness.

I’ve experimented with merging back the two threads, and I can see that the slowness is gone.

Unfortunately, we can’t suggest that you do the same for a shipping product, and this is a problem that we are already aware of, and we are actively looking for a solution.

I’m sorry to say that we don’t have a workaround for this at the moment.

Regards,

Hugo Lamarche

Thanks for your investigation and soon feedback. I have observed same phenomenon while process one keyboard input, each sub function need a cross thread call, it took extra cost. Hope you can solve this issue in the future unreal version.

[Image Removed]