Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 775
klexx Avatar asked May 16 '17 07:05

klexx


2 Answers

@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.

like image 175
udiboy1209 Avatar answered Nov 08 '22 15:11

udiboy1209


You should try:

keyboard_mode = 'system'

It will use the real keyboard

like image 2
Yoav Glazner Avatar answered Nov 08 '22 15:11

Yoav Glazner