Search code examples
pythonkeyboardhidekivytextinput

Python Kivy: hide virtual keyboard in Text Input Field


I am using the python kivy framework to develop a GUI which will then be most probably used on a desktop PC with (hardware) mouse and keyboard. My problem now is that when using the Text Input class, it automatically creates a virtual keyboard if the Text Input field gets focused. Among other things I tried to set the option

keyboard_mode = 'managed'

implemented in my main the following way:

textinputfield = TextInput(text="some initial text here", text_size=self.size, keyboard_mode='managed')

which actually hides the keyboard but unfortunately also prevents the user from entering any data into the field.... I can't find any solution on google. Do you have any ideas?


Solution

  • @Yoav was close enough in his answer.

    You need to set keyboard_mode=system in your kivy configuration, and not in the TextInput. If you always want to use the system keyboard, you can make this change in ~/.kivy/config.ini.

    Check Kivy config for more options, like setting this variable on a per-app basis etc.