我正在尝试在Raspberry Pi3上设置一个“非品牌”触摸屏,当我运行我的python / kivy程序时遇到一些麻烦,视觉上一切都很好,但每当我需要移动一个滑块时,推一个按钮或其他什么。输入的y轴是反转的,请注意,当我在我的Windows机器上运行它时,它工作正常 As you can see the input for the buttons are inverted on the y axis
我知道这存在并且我已经尝试过,但它没有解决问题(在我的情况下)。 https://stackoverflow.com/a/34344458/7522859
我已经尝试在(在我的情况下)(.kivy / config.ini)下的配置文件中修复它,正如您所看到的那样,它会读取invert_y选项但不会同时执行1和0作为其值
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
所以问题是如何在kivy配置文件中反转输入的Y轴。我也看了一下this我并没有真正理解它,也许我只是愚蠢。
很抱歉,如果这篇文章不好的话。它的第一篇文章和英语不是我的母语。
答案 0 :(得分:1)
我终于开始工作了。
我更改了hidinput.py
下的第417行:
/usr/local/lib/python2.7/dist-packages/kivy/input/providers/hidinput.py
信用:How do if invert touch input in Kivy
并设置配置:
~/.kivy/config.ini
下的
ADS7846 = hidinput,/dev/input/event2,invert_y=0