欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

android4.0與2.3版本的TP代碼區(qū)別解析

 更新時(shí)間:2014年07月23日 11:38:05   投稿:shichen2014  
這篇文章主要介紹了android4.0與2.3版本的TP代碼區(qū)別,需要的朋友可以參考下

通常來(lái)說(shuō)在android2.3上調(diào)試TP時(shí),只需要把linux驅(qū)動(dòng)調(diào)通,android就可以正常使用了。但是到了android4.0上又有些不同了,針對(duì)linux驅(qū)動(dòng),需添加如下一些內(nèi)容:

1、在手指按下時(shí)需調(diào)用如下函數(shù)上報(bào)Key Down:

input_report_key(struct input_dev *input, BTN_TOUCH, 1);

2、在手指釋放時(shí)需調(diào)用如下函數(shù)上報(bào)Key Up:

input_report_key(struct input_dev *input, BTN_TOUCH, 0);

這樣通過(guò)的話,可以在android4.0上看到有鼠標(biāo)指針(圓圈)可以移動(dòng),把觸摸屏做成了筆記本電腦上的鼠標(biāo)觸摸屏了,后來(lái)再查了下,原來(lái)需要添加一個(gè)idc文件,具體識(shí)別優(yōu)先級(jí)參考:http://source.android.com/tech/input/input-device-configuration-files.html這篇文檔,會(huì)按下面的順序識(shí)別配置文件:

/system/usr/idc/Vendor_XXXX_Product_XXXX_Version_XXXX.idc
/system/usr/idc/Vendor_XXXX_Product_XXXX.idc
/system/usr/idc/DEVICE_NAME.idc
/data/system/devices/idc/Vendor_XXXX_Product_XXXX_Version_XXXX.idc
/data/system/devices/idc/Vendor_XXXX_Product_XXXX.idc
/data/system/devices/idc/DEVICE_NAME.idc

為了方便,我直接創(chuàng)建一個(gè)“設(shè)備名.idc”的文件,直接放到/system/usr/idc/目錄下,相應(yīng)的內(nèi)容參考如下:

# Basic Parameters
touch.deviceType = touchScreen
touch.orientationAware = 1

# Size
touch.size.calibration = diameter
touch.size.scale = 10
touch.size.bias = 0
touch.size.isSummed = 0

# Pressure
# Driver reports signal strength as pressure.
#
# A normal thumb touch typically registers about 200 signal strength
# units although we don't expect these values to be accurate.
touch.pressure.calibration = amplitude
touch.pressure.scale = 0.005

# Orientation
touch.orientation.calibration = none

這樣配置好后,在android4.0上的TP就可以正常使用了,而不會(huì)成為滑鼠觸屏了。

相關(guān)文章

最新評(píng)論