Raspbian, my touch screen works at OS level, but not with kivy

307 views
Skip to first unread message

Gary Kuipers

unread,
May 11, 2020, 10:42:21 AM5/11/20
to Kivy users support
After developing a kivy application that works perfectly in Ubuntu 18 I installed it in Raspbian

Raspbian works perfectly with the Acer T232HL USB connected touchscreen

However, when I launch the kivy application there is no response inside the kivy window (although I can hit the [ X ] on the top right of the window and it will close).

I am guessing that since the touchscreen works but kivy does not see it, the problme is configuration, but a couple of hours of searching the internet only seems to provide "official raspberry pi screen" information which works through GPIO.

I tried the following config.ini [input] without success:

[input]
mouse = mouse
%(name)s = probesysfs

[input]
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput

[input]
mouse = mouse
stmpe-ts = hidinput,/dev/input/touchscreen,rotation=270


Here is the complete config.ini file
[kivy]
keyboard_repeat_delay = 300
keyboard_repeat_rate = 30
log_dir = logs
log_enable = 1
log_level = info
log_name = kivy_%y-%m-%d_%_.txt
window_icon =
keyboard_mode =
keyboard_layout = qwerty
desktop = 1
exit_on_escape = 1
pause_on_minimize = 0
kivy_clock = default
default_font = ['Roboto', 'data/fonts/Roboto-Regular.ttf', 'data/fonts/Roboto-Italic.ttf', 'data/fonts/Roboto-Bold.ttf', 'data/fonts/Roboto-BoldItalic.ttf']
log_maxfiles = 100
window_shape = data/images/defaultshape.png
config_version = 21

[graphics]
display = -1
fullscreen = 0
height = 600
left = 0
maxfps = 60
multisamples = 2
position = auto
rotation = 0
show_cursor = 1
top = 0
width = 800
resizable = 1
borderless = 0
window_state = visible
minimum_width = 0
minimum_height = 0
min_state_time = .035
allow_screensaver = 1
shaped = 0

[input]
mouse = mouse
#%(name)s = probesysfs
#mtdev_%(name)s = probesysfs,provider=mtdev
#hid_%(name)s = probesysfs,provider=hidinput
stmpe-ts = hidinput,/dev/input/touchscreen,rotation=270

[postproc]
double_tap_distance = 20
double_tap_time = 250
ignore = []
jitter_distance = 0
jitter_ignore_devices = mouse,mactouch,
retain_distance = 50
retain_time = 0
triple_tap_distance = 20
triple_tap_time = 375

[widgets]
scroll_timeout = 250
scroll_distance = 20
scroll_friction = 1.
scroll_stoptime = 300
scroll_moves = 5

[modules]

[network]
useragent = curl

Elliot Garbus

unread,
May 11, 2020, 11:10:00 AM5/11/20
to kivy-...@googlegroups.com

I’m not a Rasberry Pi user, but taking a quick look at the docs…

There are a set of env variables described on the bottom of the page: https://kivy.org/doc/stable/guide/environment.html#environment

 

It looks like this might help.

 

KIVY_BCM_DISPMANX_ID

Change the default Raspberry Pi display to use. The list of available value is accessible in vc_dispmanx_types.h. Default value is 0:

·        0: DISPMANX_ID_MAIN_LCD

·        1: DISPMANX_ID_AUX_LCD

·        2: DISPMANX_ID_HDMI

·        3: DISPMANX_ID_SDTV

·        4: DISPMANX_ID_FORCE_LCD

·        5: DISPMANX_ID_FORCE_TV

·        6: DISPMANX_ID_FORCE_OTHER

KIVY_BCM_DISPMANX_LAYER

Change the default Raspberry Pi dispmanx layer. Default value is 0.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ece4de1b-5c08-426b-88d2-fbdad4a1a7f6%40googlegroups.com.

 

Gary Kuipers

unread,
May 12, 2020, 9:44:27 AM5/12/20
to Kivy users support
The problem is not that the screen does not work. The kivy application comes up perfectly and responds to mouse clicks as it should.
Also note, the touchscreen communicates perfectly with the raspbian operating system. Any touch of the screen reacts appropriately.
The problem IS, that in the area where the kivy application is on the screen, touch does not work as a mouse click.
The cursor WILL move to the touched position BUT, no on-click.

Gary Kuipers

unread,
May 14, 2020, 7:16:49 PM5/14/20
to Kivy users support
This is both interesting and disturbing: I ordered the "Official Raspberry Pi 7" Screen  Display" figuring it HAD to work with that. Guess what ... NOPE! It has exactly the same behaviour as with The Acer touchscreen.

So the question is: Where in kivy or configuration could the problem be?

Gary Kuipers

unread,
May 14, 2020, 7:58:03 PM5/14/20
to Kivy users support
AHA: https://github.com/mrichardson23/rpi-kivy-screen


Go into the [input] section, remove the lines that are in there and put in:

mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
BINGO, it works!
Reply all
Reply to author
Forward
0 new messages