Hello,
I just wrote simple code to check when mouse button was pressed:
from
kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.widget import Widget
liczba = 0
class MyApp(App):
def build(self):
parent = Widget()
def nacisnij(self):
global liczba
print liczba
liczba = liczba + 1
a = Button(text='My first button')
a.bind(on_press=nacisnij)
c = Label(text='testowy')
if 'button' in touch.profile:
print 'touch have a button pressed:', touch.button
parent.add_widget(c)
parent.add_widget(a)
return parent
if __name__ == '__main__':
MyApp().run()
but It's not working I dont see any "touch have a button pressed:' in console and I have an error :(
if 'button' in touch.profile:
NameError: name 'touch' is not defined
why?