I am trying to setup a "off-brand" touchscreen on a Raspberry Pi3 and I am having some trouble when I run my python/kivy program, visually everything is fine, but whenever I need to move a slider, push a button or whatever. the input y-axis is inverted, note that it works fine when i run this on my windows machine As you can see the input for the buttons are inverted on the y axis
I do know this exists and I have tried it, but it did nothing to solve the problem (In my case). https://stackoverflow.com/a/34344458/7522859
And I have tried to fix it in the config file under (in my case) (.kivy/config.ini), and as you can see it reads the invert_y option but does nothing with both 1 and 0 as its values.
root@raspberrypi:/media/pi/64D933A55CDD560F/PrinterSoftware# python MC.py
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_17-02-06_10.txt
[INFO ] [Kivy ] v1.9.2.dev0, git-57d41c9, 20170206
[INFO ] [Python ] v2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2]
[INFO ] [Factory ] 193 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
[INFO ] [GL ] OpenGL vendor <Broadcom>
[INFO ] [GL ] OpenGL renderer <VideoCore IV HW>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Shader ] fragment shader: <Compiled>
[INFO ] [Shader ] vertex shader: <Compiled>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event2
[INFO ] [HIDInput ] Read event from </dev/input/event2>
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [HIDInput ] Set custom invert_y to 0
[INFO ] [Base ] Start application main loop
So the question is how do I invert the Y-axis for the input in the kivy config file. I have also taken a look at this and I didn't really understand it that well, maybe I am just stupid.
Sorry if this post is bad. Its my first post and English is not my native language.
I got it to work, finally.
I changed the line 417 in the hidinput.py
under:
/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py
Credit: How do if invert touch input in Kivy
and set the config:
~/.kivy/config.ini
under [input]
ADS7846 = hidinput,/dev/input/event2,invert_y=0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With