Hello list,
I'm working to integrate a custom touchscreen driver into Android
ICS for use on a
beaglebone platform.
I think I am close to getting this working, but I'm running into problems getting the Android system to accept input events from the touchscreen driver.
My driver registers with the Linux input driver just fine. The device gets registered as /dev/input/event0 and it also shows up in /sys/devices/virtual/input/input0.
The problem is that I can't seem to get the touchscreen input to move the screen cursor or manipulate any GUI objects on the LCD screen.When I run
getevent, I get what looks to me like expected output, for instance:
root@android:/ # getevent
add device 1: /dev/input/event0
name: "ft5x0x_ts"
could not get driver version for /dev/input/mouse0, Not a typewriter
could not get driver version for /dev/input/mice, Not a typewriter
add device 2: /dev/input/event1
name: "Logitech USB Optical Mouse"
could not get driver version for /dev/input/mouse1, Not a typewriter
/dev/input/event0: 0001 014a 00000001
/dev/input/event0: 0003 0000 00000170
/dev/input/event0: 0003 0001 00000103
/dev/input/event0: 0003 0018 000000c8
/dev/input/event0: 0000 0000 00000000
/dev/input/event0: 0003 0000 0000016f
/dev/input/event0: 0000 0000 00000000
/dev/input/event0: 0003 0001 00000102
/dev/input/event0: 0000 0000 00000000
/dev/input/event0: 0003 0018 00000000
/dev/input/event0: 0001 014a 00000000
/dev/input/event0: 0000 0000 00000000
I have also added an Input Device Configuration File, per
http://source.android.com/tech/input/input-device-configuration-files.html. It looks like this:
root@android:/ # cat /system/usr/idc/ft5x0x_ts.idc
# Input configuration file for ft5x0x_ts touchscreen input device.
# This is an internal device
device.internal = 1
touch.deviceType = touchScreen
touch.orientationAware = 0
keyboard.layout = qwerty
keyboard.characterMap = qwerty2
cursor.mode = navigation
cursor.orientationAware = 0
Other information:
- The touchscreen device is an I2C device. (Not sure if it needs to look like a HID device to Android for it to be used. If so, then I'm not sure how to do that.)
- The driver is operating it in a non multi-touch mode. It is reporting
BTN_TOUCH
key code for touches and using ABS_X
and ABS_Y
absolute values for X-Y coordinates. I checked the coordinates that are being reported, and they are in range and seem to be correct for the finger position on the panel. - The USB mouse that shows up in the getevent output is plugged into the beaglebone host USB port. It does move the cursor and can manipulate GUI objects just fine. The touchscreen will not work with or without the mouse plugged in.
- Before I discovered the getevent utility, I wrote a utility that is similar to the Linux utility mev that I call pev. Here is some sample output:
root@android:/ # pev /dev/input/event0
device name: ft5x0x_ts
Supported event types:
Event type 0x00 (Synch Events)
Event type 0x01 (Keys or Buttons)
Event type 0x03 (Absolute Axes)
-------
Count: 80
Event: time 3259.132350 type 1 code 330 value 1
Event: time 3259.132380 type 3 code 0 value 397
Event: time 3259.132380 type 3 code 1 value 201
Event: time 3259.132380 type 3 code 24 value 200
Event: time 3259.132380 type 0 code 0 value 0
Count: 32
Event: time 3259.141627 type 3 code 1 value 203
Event: time 3259.141627 type 0 code 0 value 0
Count: 32
Event: time 3259.162501 type 3 code 1 value 205
Event: time 3259.162501 type 0 code 0 value 0
Count: 32
Event: time 3259.184474 type 3 code 1 value 208
Event: time 3259.184474 type 0 code 0 value 0
Count: 32
Event: time 3259.205653 type 3 code 1 value 213
Event: time 3259.205653 type 0 code 0 value 0
Count: 48
Event: time 3259.247249 type 3 code 24 value 0
Event: time 3259.247249 type 1 code 330 value 0
Event: time 3259.247279 type 0 code 0 value 0
If you have any ideas, please respond to help me solve this problem.
Thanks.
--ken