Я нашел этот фрагмент кода:
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
class Test(BoxLayout):
def __init__(self, **kwargs):
super(Test, self).__init__(**kwargs)
Window.bind(on_touch_down=self.window_on_touch_down)
def window_on_touch_down(self, *args):
print(args)
# scrolling the wheel down will give <MouseMotionEvent button="scrollup"
if '<MouseMotionEvent button="scrollup"' in args:
print('hello')
class TestApp(App):
def build(self):
return Test()
if __name__ == '__main__':
TestApp().run()
, и пока он печатает движение прокрутки, я не могу его использовать ... args содержит строку, но if не работает и " привет "не печатается ... кто-нибудь знает почему?