Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23390

VKeyboard in kv file not work for TextInput

$
0
0

I want to Write something in my TextInput Box with My VKeyboard in kivy language .but it's not work.I've use json for VKeyboard becouse I not found another way for it.if you know how can I use VKeyboard plz tell me .

I want to use VKeyboard on .kv file

this is my code (kivy code with kv file ):

from kivy.app import Appfrom kivy.uix.widget import Widgetfrom kivy.lang import Builderfrom kivy.properties import ObjectPropertyfrom kivy.uix.screenmanager import ScreenManager , Screenfrom kivy.uix.image import Imagefrom kivy.core.window import Windowfrom kivy.base import runTouchAppfrom kivymd.app import MDAppfrom kivy.clock import Clockfrom kivy.properties import StringPropertyfrom kivy.uix.vkeyboard import VKeyboardclass StartTestBtn(Screen):    def read_data(self):        print(self.ids.ti.text)class WindowManager(ScreenManager):    pass        Builder.load_string("""#:import utils kivy.utils<WindowManager>:    StartTestBtn:<StartTestBtn>:    name: "startTestBtn"    BoxLayout:        cols:1        orientation: "vertical"        size: root.width , root.height        padding: 100, 300, 300 , 500        TextInput:            id : ti            text : ti.text            multiline:False            size_hint_x: 1            height: 50            size_hint_y: None            width: 200            hint_text: "Enter User ID"            icon_right: "account"            font_size:24    BoxLayout:        cols:1        orientation: "vertical"        size: root.width , root.height        padding: 1000, 30, 30 , 400    VKeyboard:        layout: 'numeric.json'""")class Shenacell(MDApp):    def build(self):        self.theme_cls.theme_style = "Dark"        self.theme_cls.primary_palette = "BlueGray"        return WindowManager()if __name__ == '__main__' :    Shenacell().run()

and this is my json file :

{"title": "Qwerty","description": "A classical US Keyboard","cols": 15,"rows": 5,"normal_1": [        ["`", "`", "`", 1],    ["1", "1", "1", 1],    ["2", "2", "2", 1],        ["3", "3", "3", 1],    ["4", "4", "4", 1],    ["5", "5", "5", 1],        ["6", "6", "6", 1],    ["7", "7", "7", 1],    ["8", "8", "8", 1],        ["9", "9", "9", 1],    ["0", "0", "0", 1],    ["-", "-", "-", 1],        ["=", "=", "=", 1],    ["\u232b", null, "backspace", 2]    ],"normal_2" : [        ["\u21B9", "\t", "tab", 1.5],  ["q", "q", "q", 1],    ["w", "w", "w", 1],        ["e", "e", "e", 1],    ["r", "r", "r", 1],    ["t", "t", "t", 1],        ["y", "y", "y", 1],    ["u", "u", "u", 1],    ["i", "i", "i", 1],        ["o", "o", "o", 1],    ["p", "p", "p", 1],    ["[", "[", "[", 1],        ["]", "]", "j", 1],    ["\\", "\\", "\\", 1]    ],"normal_3": [        ["\u21ea", null, "capslock", 1.8],  ["a", "a", "a", 1],    ["s", "s", "s", 1],        ["d", "d", "d", 1],    ["f", "f", "f", 1],    ["g", "g", "g", 1],        ["h", "h", "h", 1],    ["j", "j", "j", 1],    ["k", "k", "k", 1],        ["l", "l", "l", 1],    [":", ":", ":", 1],    ["'", "'", "'", 1],        ["\u23ce", null, "enter", 2.2]    ],"normal_4": [        ["\u21e7", null, "shift", 2.5],  ["z", "z", null, 1],    ["x", "x", "x", 1],        ["c", "c", "c", 1],    ["v", "v", "v", 1],    ["b", "b", "b", 1],        ["n", "n", "n", 1],    ["m", "m", "m", 1],    [",", ",", ",", 1],        [".", ".", ".", 1],    ["/", "/", "/", 1],    ["\u21e7", null, "shift", 2.5]    ],"normal_5": [        [" ", " ", "spacebar", 12], ["\u2b12", null, "layout", 1.5], ["\u2a2f", null, "escape", 1.5]    ],"shift_1": [        ["~", "~", "~", 1],    ["!", "!", "!", 1],    ["@", "@", "@", 1],        ["#", "#", "#", 1],    ["$", "$", "$", 1],    ["%", "%", "%", 1],        ["^", "^", null, 1],   ["&", "&", "&", 1],    ["*", "*", "*", 1],        ["(", "(", "(", 1],    [")", ")", ")", 1],    ["_", "_", "_", 1],        ["+", "+", "+", 1],    ["\u232b", null, "backspace", 2]    ],"shift_2": [        ["\u21B9", "\t", "tab", 1.5],  ["Q", "Q", null, 1],    ["W", "W", null, 1],        ["E", "E", "e", 1],    ["R", "R", "r", 1],    ["T", "T", "t", 1],        ["Y", "Y", "y", 1],    ["U", "U", "u", 1],    ["I", "I", "i", 1],        ["O", "O", "o", 1],    ["P", "P", "p", 1],    ["{", "{", "{", 1],        ["}", "}", "}", 1],    ["|", "|", "|", 1.5]    ],"shift_3": [        ["\u21ea", null, "capslock", 1.8],  ["A", "A", "a", 1],    ["S", "S", "s", 1],        ["D", "D", "d", 1],    ["F", "F", "f", 1],    ["G", "G", "g", 1],        ["H", "H", "h", 1],    ["J", "J", "j", 1],    ["K", "K", "k", 1],        ["L", "L", "l", 1],    [";", ";", ";", 1],    ["\"", "\"", "\"", 1],        ["\u23ce", null, "enter", 2.2]    ],"shift_4": [        ["\u21e7", null, "shift", 2.5],  ["Z", "Z", "z", 1],    ["X", "X", "x", 1],        ["C", "C", "c", 1],    ["V", "V", "v", 1],    ["B", "B", "b", 1],        ["N", "N", "n", 1],    ["M", "M", "m", 1],    ["<", "<", "<", 1],        [">", ">", ">", 1],    ["?", "?", "?", 1.5],    ["\u21e7", null, "shift", 2.5]    ],"shift_5": [        [" ", " ", "spacebar", 12], ["\u2b12", null, "layout", 1.5], ["\u2a2f", null, "escape", 1.5]    ]}

Viewing all articles
Browse latest Browse all 23390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>