lmstudio-ai / lmstudio-bug-tracker

Bug tracking for the LM Studio desktop application
7 stars 3 forks source link

Suggestion for Enhanced Input Handling for IME #75

Open AdemJensen opened 2 months ago

AdemJensen commented 2 months ago

When users switch between English and Chinese (or other languages) characters without changing their keyboard layout, they often type in English characters directly through the IME, which temporarily holds these inputs until confirmed. In this context, pressing Enter is necessary to commit the typed text into the chat window rather than select specific characters from an IME candidate list.

However, as currently designed, your software mistakenly interprets the Enter key press as a command to send messages immediately, even when the user intends only to finalize their mixed-language input. This unexpected behavior can lead to unintended message submissions and frustration among users accustomed to this typing style.

To address this issue, I propose an enhancement that would allow your chat software to intelligently differentiate between different stages of text entry based on IME state. Specifically:

Here is a video to present the issue: I was intended to input "这是一段中文输入PlusE 后续内容", but after I enter "PlusE" I pressed Enter, which just send the partially-done content into the chat zone, I had to switch the keyboard layout to achieve this.

https://github.com/user-attachments/assets/c2420364-b17e-4fbb-95b7-16b4ed93bc3c

And here is a video showing what is intended to be like (I took QQ as an example): when I enter "andE" and press Enter key, the "andE" content just gets confirmed rather than sending the partially-done content.

https://github.com/user-attachments/assets/bffaa3da-b72a-4e85-ac87-cd46f0415c7d

morigs commented 3 weeks ago

I have the same problem with Japanese IME, this unfortunately makes LM Studio chat almost unusable. I have to copy-paste each message from external text editor

yagil commented 3 weeks ago

@AdemJensen and @morigs: in LM Studio 0.3.2 we have an option in Settings to send messages on Shift + Enter, instead of just Enter. Does that solve the problem?

morigs commented 3 weeks ago

@yagil thanks for the tip, it working now!

However, IMO it's better to change the chat event from onkeyup to onsubmit, I think this should resolve the issue