I want to make a Chinese input box, but I don't know how to use input method to get Chinese input
love2d如何获取输入法输入的结果
thanks!
How to connect with input method to obtain Chinese input
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 1
- Joined: Tue Aug 11, 2020 2:10 am
Re: How to connect with input method to obtain Chinese input
To get text input you use love.textedited for text currently being inputted (but not yet committed), and love.textinput for the final/committed text input.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
-
- Prole
- Posts: 2
- Joined: Wed Aug 19, 2020 4:13 am
Re: How to connect with input method to obtain Chinese input
没办法直接获取,但是2018年的时候某位仁兄找到了解决方案,通过重编译SDL2可以让输入法备选框显示出来
具体办法是先下载SDL的开发包,然后找到SDL_windowskeyboard.c
修改IME_Init()函数里的videodata->ime_uilesss = UILess_SetupSinks(videodata);
把这段代码注释掉,然后手动编译一份DLL
最后把love目录下的dll替换成编译好的文件。这里我已经准备了一份,可以给11.3用。
如果需要编译其他版本的,可能需要先找到能够适配当时的love的sdl才能重新编译?这一块需要证实。
具体办法是先下载SDL的开发包,然后找到SDL_windowskeyboard.c
修改IME_Init()函数里的videodata->ime_uilesss = UILess_SetupSinks(videodata);
把这段代码注释掉,然后手动编译一份DLL
最后把love目录下的dll替换成编译好的文件。这里我已经准备了一份,可以给11.3用。
如果需要编译其他版本的,可能需要先找到能够适配当时的love的sdl才能重新编译?这一块需要证实。
- Attachments
-
- SDL2.zip
- (395.53 KiB) Downloaded 237 times
-
- Prole
- Posts: 6
- Joined: Fri Mar 20, 2020 9:21 am
Re: How to connect with input method to obtain Chinese input
Thanks for sharing! The works well.
Code: Select all
SDL2.dll
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests