Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
525 views
in Technique[技术] by (71.8m points)

python - How to properly use Virtual Keyboard with Kivy on Android device

I have a simple python/kivy code like this (found on this webiste) which demondstrates how to show custom Virtual Keyboard.

import kivy
kivy.require("1.11.1")
from kivy.config import Config
Config.set("kivy", "keyboard_mode", 'dock')
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.textinput import TextInput


Window.size = (1080 / 3, 2127 / 3)


class Calc(TextInput):
    def _keyboard_close(self):
        pass

    def setup_keyboard(self):
        kb = Window.request_keyboard(self._keyboard_close, self)
        if kb.widget:
            kb.widget.layout = 'numeric.json'
            kb.widget.font_size = 100
            kb.widget.height = 500


class TestApp(App):
    def build(self):
        root = Calc()
        root.setup_keyboard()
        return root


if __name__ == '__main__':
    TestApp().run()

Unfortunately when I transfer it to apk file and run it on my Android device, then I have two keyboards on the screen. One Virtual keyboard and over it there is Android system keyboard.

Is there a way how to get rid of this android system keyboard?

Thank for answer.

question from:https://stackoverflow.com/questions/66047969/how-to-properly-use-virtual-keyboard-with-kivy-on-android-device

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...