dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

No TSF support? #3687

Closed ryancheung closed 6 months ago

ryancheung commented 4 years ago

Is your feature request related to a problem? Please describe.

I want to make a game with SharpDX(DirectX 11), which depends on WinForms. The game is going to target CJK users, which users must use a IME software to do text inputs, e.g. type Chinese characters with Microsoft PinYin.

Then as for IME, Windows has two frameworks, IMM32 for WinXP and before, and then TSF for Window versions after WinXP.

Now here comes the problem: Dotnet winforms does not support TSF(unless you do it manually in native cpp, just like Chromim, Firefox or Microsoft Terminal). This cause a situation that if you want to render composition string and/or candidate list manually in fullscreen game, you only have IMM32 managed API. If you use IMM32 API to fetch composition string/candidate list, there will be bugs with TSF-based Input Method, such as Microsoft PinYin, you can't get candidate list most of the time. But, there's no bug for purely IMM32-based Input Methods, like Sougou PinYin. To fix that issue, you have to utilize the TSF API in native cpp, but TSF is too complicate. It's not an easy work for dotnet developers.

So I just hope dotnet winforms could provide support for TSF. Just like the work be done in WPF core:

WPF core has everything for TSF.

Describe the solution you'd like and alternatives you've considered

Will this feature affect UI controls?

No

ryancheung commented 4 years ago

I just made a IME library myself https://github.com/ryancheung/ImeSharp Anyone need a IME API for games could try it.