You can make textinput behind the button and make the button render as text input.
When you click a button, put the focus in the text line and refresh the button text.
I gave an example here.
from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout from kivy.uix.button import Button from kivy.uix.label import Label from kivy.clock import Clock from kivy.app import App from kivy import require require('1.9.1') class MyWidget(BoxLayout): def __init__(self,**kwargs): super(MyWidget,self).__init__(**kwargs) self.orientation = "vertical" self.cur = False self.textinput = TextInput(text='',halign="center",multiline=False) self.textinput.bind(text=self.on_text) self.button = Button(background_normal="",background_color=[0,0,0.1,1],font_size="40sp") self.button.bind(on_release=self.button_click) self.my_float_layout = FloatLayout() self.my_float_layout.add_widget(self.textinput) self.my_float_layout.add_widget(self.button) self.add_widget(Label(text="type text below",font_size="40sp")) self.add_widget(self.my_float_layout) Clock.schedule_interval(self.cursor, 0.5) def cursor(self,dt):
source share