IME- How to terminate the in-progress composition

Parmod Kumar
1
Reputation point
I have created 2 custom edit boxs (drawing rectangle and text) in a single window (language C++)
when I start typing in first editbox then TSF start composition, then if click 2nd edit box and type a character 1st edit box composition text get prepended , please see the attached images.
I tried calling ITfContextOwnerCompositionServices::TerminateComposition but still I get previous composition text in settext() call back function.
{count} votes
@Jeanine Zhang-MSFT :
I didn't find any option to attached the code, and would be difficult to explain without the complete code & .exe.
But you can try sample app: https://github.com/zupet/TSF-Test
I took the referenece from it and the only change is that I am drawing text in multiple rectangles (in same window , see the attached image)
Please let me know if there is any other sample app for UI less mode.
@Parmod Kumar
There seems to be only one edit box in the sample app you provided, so we couldn't reproduce your issue.
Could you please provide a minimal, reproducible sample?
I have uploaded sample applications in github: https://github.com/divineaugustine/windowsime
there are 2 sample applications, please use IMEsample1 :
This happens as TSF doesn't know when to reset the composition text, untill we press space or enter key
I looking for a solutions to end/reset the composition when moving out/in of edit box
Let me know if you need more details
windowsime
@Parmod Kumar
I still couldn't reproduce your issue.
1,click on 1st edit box and type few chars, we see a composition text and IME candidate list
2,click on 2nd editbox and type a char, we didn't see the previous typed chars(1st edit box) are prepended
Could you please tell us, if I misunderstood any steps?
Thanks for the response
not sure why its not reproducing at your PC as steps are same.
which OS version are you using.
mine is - window 10 version 1909 (OS Build 18363.2037)
os version : Windows 11 Enterprise 21H2 (OS Build 22000.434)
And I also try to use win10 (Windows 10 Enterprise 2004 (OS Build 19041.1415)) to reproduce the issue, but still couldn't reproduce the issue.
Adding the link to the source code of the sample and some images to understand the context
https://github.com/divineaugustine/windowsime
Sign in to comment