Skip to content
Advertisement

Kivy on_release not working on touchscreen – SDL issue?

I have developed a basic app with Kivy but on_release does not work properly on my button bind. I can get on_press to work every time but on_release works sporadically (maybe one in ten to twenty times) and sometimes on a different part of the screen than you’ve touched.

I’m pretty confident it’s not a coding issue and one of the Kivy devs said it is not a known issue and should work but they haven’t said where I might dig deeper.

In tandem with this, I have been receiving an SDL error in terminal: INFO: The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list <https://discourse.libsdl.org/> EVDEV KeyCode 330

This appears on both touch and release. EVDEV advised to upgrade to SDL2, which I did and it has not solved the error which could just apparently be ignored if not for the spam it creates.

I’m not sure if these two issues are linked but don’t know where to start with troubleshooting.

Can anyone please help with what steps I could follow to try and get this resolved?

I mostly want to fix on_release but if we fix the other error in the process then that would be great too.

I am running a Raspberry Pi Zero W, Raspbian Buster w/Desktop and a Hyperpixel 4.0 square screen

Advertisement

Answer

So the SDL error seemed to disappear in the latest version of Raspberry Pi OS (as opposed to Raspbian Buster).

The issue with on_release turns out to be an issue with Kivy’s [postproc:calibration] settings in /.kivy/config.ini. I am using settings there to invert the touch as my provider has inverted x,y coordinates. The issue is that kivy doesn’t seem to use the inversion settings for on_touch_up, only on_touch_down and therefore doesn’t dispatch on_release.

Issue raised on GitHub here

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement