I am using Kivy on Raspberry Pi, utilizing the new official 7" touchscreen. I am trying to make an application that utilizes the touch screen for simple button/accordion operations but the input does not reach the kivy program. Am I missing something important from the below code?
The touchscreen works fine in X, and I can also cat /dev/input/event0 and see data on the buffer when making multitouch gestures.
According to Kivy itself, I'm definitely initializing the touchscreen when starting the app:
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_15-09-16_22.txt
[INFO ] [Kivy ] v1.9.1-dev
[INFO ] [Python ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO ] [Factory ] 177 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_pygame (img_pil, img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[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 ] [Text ] Provider: pygame
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <FT5406 memory based driver>
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range ABS X position is 0 - 800
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range ABS Y position is 0 - 480
[INFO ] [GL ] NPOT texture support is available
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range position X is 0 - 800
[INFO ] [HIDMotionEvent] <FT5406 memory based driver> range position Y is 0 - 480
My source code is very elementary:
import kivy
kivy.require('1.0.7')
from kivy.app import App
def button_pressed():
exit(0)
class CarInterfaceApp(App):
pass
if __name__ == '__main__':
CarInterfaceApp().run()
and my kv file is likewise pretty simple:
#:kivy 1.0
Accordion:
min_space: 60
orientation: 'vertical'
AccordionItem:
title: 'Car'
AccordionItem:
title: 'Music'
AccordionItem:
title: 'Messaging'
I had 2 issues to solve to get this working on Arch Linux Arm.
The first issue was the one that Peter's answer covers - I didn't have mtdev in my config. I set the [input] section of my ~/.kivy/config.ini to
[input]
mouse = mouse
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
The 2nd issue was that the stderr had
[INFO ] [ProbeSysfs ] unable to found provider mtdev
[INFO ] [ProbeSysfs ] fallback on hidinput
The solution here was to install mtdev with pacman -S mtdev
It turns out that the default config file for kivy, config.ini, has provider=hidinput in the [input] section. If you change this to provider=mtdev, the FT5406 works fine!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With