Kivy MotionEvent:在鼠标位置上

2024-09-27 09:34:57 发布

您现在位置:Python中文网/ 问答频道 /正文

kivy是否支持在鼠标改变时触发的MouseEvent而不按鼠标键?在

我在文件中发现:

def on_motion(self, etype, motionevent):
    # will receive all motion events.
    pass

Window.bind(on_motion=on_motion)

You can also listen to changes of the mouse position by watching mouse_pos.

但是我不能实现它。我设法将它绑定并添加到on_motion函数“print('Hello world')”,但它只由按type events触发。在

提前谢谢


Tags: 文件selfondef鼠标eventswillmotion

热门问题