我已安装了来自waveshare的HDMI触摸屏 - https://www.waveshare.com/7inch-HDMI-LCD-C.htm
触摸事件在Raspian Stretch上运行良好,但在Kivy应用程序中不起作用。
这是输出:
pi@raspberrypi:~ $ python3 kivy/examples/demo/showcase/main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_18-02-14_6.txt
[INFO ] [Kivy ] v1.10.1.dev0, git-a4d93d6, 20180211
[INFO ] [Python ] v3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <b'OpenGL ES 2.0'>
[INFO ] [GL ] OpenGL vendor <b'Broadcom'>
[INFO ] [GL ] OpenGL renderer <b'VideoCore IV HW'>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
[INFO ] [Clipboard ] Provider: xclip(['clipboard_dbusklipper', 'clipboard_gtk3'] ignored)
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [GL ] NPOT texture support is available
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <b'Logitech K400 Plus\x00 '>
[INFO ] [HIDMotionEvent] using <b'WaveShare WaveShare Touchscreen\x00 '>
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range ABS X position is 0 - 1024
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range ABS Y position is 0 - 600
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range ABS pressure is 0 - 255
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range position X is 0 - 1024
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range position Y is 0 - 600
[INFO ] [HIDMotionEvent] <b'WaveShare WaveShare Touchscreen\x00 '> range pressure is 0 - 255
我尝试将输入提供程序添加到~/.kivy/config.ini
中,如下所示:
[input]
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
不确定[input]
部分应该是什么。
答案 0 :(得分:0)
我正在使用这个确切的显示屏和触摸屏。尽管我在rpi4上使用了buster。 我发现如果kivy应用程序在没有装饰的情况下全屏运行,那么只要[input]下的ONLY项为
[input]
mtdev_%(name)s = probesysfs,provider=mtdev
基本上,您将不会使用Xwindows输入或HID输入。 还要确保[kivy]部分下的keyboard_mode = systemanddock。