10.14 Android Input System _ multi-touch drive test and reader threading, inputstage analysis

Source: Internet
Author: User

Tag: row needs to be different from the his read array application. com place

21. Multi-Touch _ Capacitive Screen Driver _ practice _tiny4412

tiny4412 Touch Screen: 480 x Resolution
Http://wiki.friendlyarm.com/wiki/index.php/LCD-S702/zh

Test:
A. Remove the original FT5X06_TS.C driver first
I²c Drive has i2c_driver, i2c_device,ft5x06_ts.c just I2c_driver,
Modify the makefile in the same directory:
obj-$ (config_touchscreen_ft5x0x) + = FT5X06_TS.O
Switch
obj-$ (config_touchscreen_ft5x0x) + = MTP_INPUT.O

B. Modify Arch/arm/mach-exynos/mach-tiny4412.c
Remove:
I2c_register_board_info (1, I2C_DEVS1, Array_size (I2C_DEVS1));
Do not remove also can, need to modify MTP_INPUT.C:
static const struct I2C_DEVICE_ID mtp_id_table[] = {
{"100ask_mtp", 0},
{"Ft5x0x_ts", 0},//Add this sentence
{}
};


C. Make Zimage

When registering for I²c driver,
A. It will first determine whether the existing I²c DEVICE in the system can be supported,
Assuming that the I²C device is located on the nth I²c bus, the address is a

B. On each i²c bus (bus), use the addr in address_list to detect the presence of a supported device
However, the nth I²c bus, the device with address A, is ignored because the device name registered in I2c_register_board_info (1, I2C_DEVS1, Array_size (I2C_DEVS1)) is used Ft5x0x_ts, is not compatible with our driver, so when registering the I²c driver, when judging whether the system can support the existing I²C device, will not match the device, followed by the driver in the i2c_driver structure in the address_list address a ignored, So the touchscreen device in this process will not add the IIC device through Add_new_device, and then call the probe function, so if you do not remove I2c_register_board_info (1, I2C_DEVS1, Array_size (i2c_ DEVS1)), you must add {"Ft5x0x_ts", 0} in the driver's i2c_device_id, so that you can match the existing device while registering the I²c driver, but you can also modify the kernel I2c_register_board_info

First time:
git clone https://github.com/weidongshan/DRV_0005_MultiTouchPanel.git
Or
git clone https://git.coding.net/weidongshan/DRV_0005_MultiTouchPanel.git

Update:
Git pull origin

Remove the specified version:
git checkout v3//ft5x06 driver for tiny4412


Andriod system uses a multi-touch screen process _IDC configuration file

The name of the Input_device in the driver must be set, the Android system will find the IDC profile according to the name, the Android application read through the IOCTL, the process is seen in the UML diagram of the Input_reader, The purpose of the profile is to provide Android with more information, because our drivers only provide contact information, and if our driver can provide more information, IDC files can be omitted

The 2837 rows in InputReader.cpp get the value of Touch.devicetype, according to this value to do different things, set different values, in the InputReader.cpp search this assignment process, found if the driver provided input property equals input _prot_direct, the same assignment is performed:

Add: Set_bit (input_prop_direct,input_dev->propbit) in the driver, so you can not provide IDC files

/system/usr/idc/ft5x0x_ts.idc
/data/system/devices/idc/ft5x0x_ts.idc

Https://source.android.com/devices/input/touch-devices

One of the most important:
Touch.devicetype = Touchscreen | TouchPad | pointer | Default//IDC file As long as this one is available.
Type of touch device:
Touchscreen: Touch screen, overlay on the monitor, can directly manipulate the various icons
TouchPad: Touchpad, not overlay on the monitor, need to display a cursor on the LCD to locate
Pointer: Similar to touchpad, more gesture functions ("Indirect multi-touch pointer Gestures")
Default: Determined by the system itself


Indirect multi-touch Pointer gestures
A. Single finger Tap:click. (Single finger click: click)
B. Single finger motion:move the pointer. (Single finger Movement: moving)
C. Single Finger motion Plus button presses:drag the pointer. (press + single finger move: Drag pointer)
D. Finger motion both fingers moving in the same direction:drag the area under the pointer on that direction. The pointer itself does not move.
(two fingers move in the same direction: Drag the pointer area, but pointer)
E. Finger motion both fingers moving towards each other or apart in different directions:pan/scale/rotate the area Surro Unding the pointer. The pointer itself does not move.
(two fingers move toward each other, or move in different directions: pan/scale/rotate, move, zoom out, rotate, pointer)
F. Multiple finger motion:freeform gesture.
first time:
git clone https://github.com/weidongshan/DRV_0005_MultiTouchPanel.git
or
git clone https:// Git.coding.net/weidongshan/drv_0005_multitouchpanel.git

Update:
Git pull Origin

Remove the specified version:
git Checkout v4//don ' t need IDC file again

Andriod system uses multi-touch screen process _reader thread

The ANDRIOD system uses a multi-touch screen process _inputstage

Based on App_0009_inputstage v1, get the V1 code as follows:
git clone https://github.com/weidongshan/APP_0009_InputStage.git
Or
git clone https://git.coding.net/weidongshan/APP_0009_InputStage.git

Update:
Git pull origin

Remove the specified version:
git checkout v1//override Onkeypreime/onkeydown/onkeyup, and Setonkeylistener

The source code of this section:
Git checkout v2//print stacktracestring for touch event

This section of the test in the key listening execution function to print out the stack space to analyze the call relationship between methods

Android through LOG.D (tag,log.getstacktracestring (New Throwable ()) can print the stack, find the function call place, from here to the function is called the relationship, the printed information is the top-level function , that is, call the above

Touch Event Handling Process:

Activity.dispatchtouchevent--->windows--->decor---...---> a control. dispatchtouchevent

Android's handling of touch events is activity.dispatchtouchecent and will eventually be sent to Decorview via window, with Decorview distributed to a control

The control handles touch operations as follows (the entry is view.dispatchtouchevent):
A. If the listener is set up using Setontouchlistener in advance,
OnTouch function for invoking listener: Li.mOnTouchListener.onTouch (this, event)
B. Then call View.ontouchevent (event)
C. Finally, for the released event, if the event uses Setonclicklistener to set the listener,
Call the listener's OnClick function: Li.mOnClickListener.onClick (this)

Note that the user can set up 2 listeners: Setontouchlistener, Setonclicklistener
The former can handle all touch events (Press/release/swipe, etc.), which only handles release events

How to program?
A. If you want to handle touch events before all controls, you can override the activity's dispatchtouchevent function,
It was first called
B. For a control, use the Setontouchlistener settings listener to handle all types of touch events
Using Setonclicklistener to set up listeners to handle loosened touch events
C. You can also override the control's Ontouchevent function (not recommended)

10.14 Android Input System _ multi-touch drive test and reader threading, inputstage analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.