My os is windows10 Chinese version. for input Chinese charactor, I use an IME to select word, like this:
but on a Kivy application, the Textinput widget can not activate IME select panel. for example, when i run the login demo from Kivy:
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class LoginScreen(GridLayout):
def __init__(self, **kwargs):
super(LoginScreen, self).__init__(**kwargs)
self.cols = 2
self.add_widget(Label(text='User Name'))
self.username = TextInput(multiline=False)
self.add_widget(self.username)
self.add_widget(Label(text='password'))
self.password = TextInput(password=True, multiline=False)
self.add_widget(self.password)
class MyApp(App):
def build(self):
return LoginScreen()
if __name__ == '__main__':
MyApp().run()
The app screen is:
No IME select panel popup. What i expect is:
I searched doc from Kivy homepage, all IME related pages are about mobile device, not windows.
Please help.
Finally, i change the source code of SDL2, and compile a new dll to fix it. sure it's not a good solution, but the only i've found.
download SDL2 source code here: libsdl.org
find a file named "SDL_windowskeyboard.c", open it, add a macro definition:
rebuild it, make sure choose the correct platform(win32 or x64), then copy generated dll to overwrite the original one. In my project, the sdl package is in venv envirement "venv\share\sdl2\bin"