Superleggera
Superleggera

Reputation: 163

How to use touchscreen on startup with kivy?

At the moment I am building an application in kivy for my pi 3. It should support touchscreen, as I would like to use my newly bought eGalax Inc. USB TouchController for it. The application starts and works when I just try to run it from command.

However I wish to start it from boot, without user-interaction for starting it. Like from the rc.local script. I've tried some different things already, but although the application starts, the touchscreen won't respond to my input. I'll provide my .kivy/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 = 20

[graphics]
display = -1
fullscreen = 'auto'
height = 600
left = 0
maxfps = 60
multisamples = 2
position = auto
rotation = 0
show_cursor = 1
top = 0
width = 800
resizable = 0
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,provider=hidinput
egalax = hidinput,/dev/input/event0,rotation=90,invert_y=1
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput

[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]
cursor = 1

So if anybody got it working, what did you do?

Upvotes: 2

Views: 1245

Answers (1)

Superleggera
Superleggera

Reputation: 163

After searching a while I found a solution burried in this specific site.

If you've already set your .kivy/config.ini file up to work when you use a command to start kivy, this will work for you:

"sudo cp ~/.kivy/config.ini /root/.kivy/config.ini"

It copies the config file to the root folder, which made touchscreen on boot work for me.

source

Upvotes: 2

Related Questions