pythonkeyboardkivykivymdnumeric-keypad

Numeric Keyboard with Kivy / KivyMD for MDTextField


How to make the Text Fields use the numeric android keyboard instead of the normal keyboard with all the letters? NOTE: I'm using KivyMD MDTextFields So when I click to write in the text fields a keyboard like this appears instead:

Like in this picture


Solution

  • In the py file I created my own class for custom keyboard:

    class CustomTextField(MDTextField):
        def __init__(self, *args, **kwargs):
            self.input_type = "number"
            self.input_type = "tel"
            self.input_filter = 'float'
            self.multiline = False
            super().__init__(**kwargs)
    

    And then in the buildozer.spec file I changed the line:

    p4a.branch = master
    

    to:

    p4a.branch = develop