python – Config Kivy> y轴的反转输入
作者:互联网
我试图在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,我并没有真正理解它,也许我只是愚蠢.
对不起,如果这篇文章不好.它的第一篇文章和英语不是我的母语.
解决方法:
我终于让它上班了.
我更改了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
标签:python,kivy,raspberry-pi3,kivy-language 来源: https://codeday.me/bug/20190706/1392406.html