Determine which mouse button was pressed in Kivy on the Raspberry Pi

I am writing a multi-platform Python program with Kivy that runs on Linux, Windows, and Raspberri Pi.

On the Raspberry Pi, I have Raspbian Jessie Lite recently installed and Kivy installed from scratch following the instructions on the Kivy website.

The program uses keyboard and mouse input, with specific actions for different mouse buttons, including wheel rotation. No problem on Linux and Windows.

On the Raspberry Pi, every part of the program works well except for mouse input. First, the cursor was invisible until I added it to the Kivy config.ini file:

[modules]
touchring = show_cursor=true
cursor = 1

      

Now, the rest of the problem is that when trying to read the "button" property of the click event inside the on_touch_down () function, the program triggered (to determine which button was clicked), saying that "HIDMotionEvent" has no attribute 'button'. , the mouse wheel rotation is not even registered as a click event (it works on other systems).

It probably depends on the vendor, and the relevant lines in the Kivy config are:

[input]
mouse = mouse,disable_multitouch
%(name)s = probesysfs,provider=hidinput

      

If I change the provider to "mtdev" or "mouse", neither the program nor the mouse will work in the program.

Any idea if Kivy on the Raspberry Pi supports detecting certain mouse buttons (including wheel rotation) and how to do that?

+3


source to share





All Articles