Python 关于上触下和上触移动

Python 关于上触下和上触移动,python,kivy,Python,Kivy,我想用鼠标左键点击来使用on_touch_down,但用鼠标右键点击和on-touch move来使用它,对任何东西都不起作用 from kivy.app import App from kivy.uix.widget import Widget from kivy.core.window import Window from kivy.graphics import Ellipse, Color, Line Window.clearcolor = (47/255, 72/255, 125/2

我想用鼠标左键点击来使用on_touch_down,但用鼠标右键点击和on-touch move来使用它,对任何东西都不起作用

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
from kivy.graphics import Ellipse, Color, Line

Window.clearcolor = (47/255, 72/255, 125/255, 1)


class PaintWindow(Widget):
    def on_touch_down(self, touch):
        s = 30
        self.canvas.add(Color(rgb=(184/255, 154/255, 200/255)))
        self.canvas.add(Ellipse(pos=(touch.x - s/2, touch.y - s/2), size=(s, s)))
        touch.ud["line"] = Line(points=(touch.x, touch.y))
        self.canvas.add(touch.ud)

    def on_touch_move(self, touch):
        touch.ud["line"].points += Line(points=(touch.x, touch.y))


class PaintApp(App):
    def bulid(self):
        return PaintWindow()
PaintApp().run()

如何解决此问题

您在触摸屏上看不到您的
结果。
或在触摸屏上看不到
结果。
。你的
PaintApp
有一个
bulid()
,可能应该是
build()
。检查你的拼写