1. 何為idc? idc(Input Device Configuration)為輸入設備配置文件,它包含設備具體的配置屬性,這些屬性影響輸入設備的行為。對於touch screen設備,總是需要一個idc文件來定義其行為。 Android基於輸入設備驅動匯報的事件類型和屬性來檢測和配置大部分輸入設備的能力。然而有些分類是模棱兩可的,如:多點觸摸屏(multi-touch touch screen)和touch pad都支持EV_ABS事件類型和ABS_MT_POSITION_X和ABS_MT_POSTION_Y事件,然而這兩類設備的使用是不同的,且不總是能自動判斷。所以,需要另外的信息來指示設備上報的pressrue和size信息的真正含義。因為,觸摸設備,特別是內嵌的touch screen,經常需要idc文件。 2. idc例子 我的觸摸屏設備的idc文件位於:/system/usr/idc目錄下,文件名為:Vendor_5697_Product_0008.idc,其內容如下: [cpp] view plaincopyprint? 1.# Filename:Vendor_5697_Product_0008.idc 2.# My TouchScreen Device configuration file. 3.# 4. 5.touch.deviceType = touchScreen 6.touch.orientationAware = 1 7. 8.keyboard.layout = Vendor_5697_Product_0008 9.keyboard.orientationAware = 1 10. 11.cursor.mode = navigation 12.cursor.orientationAware = 1 當然,在驅動程序中,驅動的name為:Vendor_5697_Product_0008,即input_dev結構的name成員值為:Vendor_5697_Product_0008。 3. idc訪問路徑及文件名規則 下列路徑被依次訪問: •/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 參考:http://source.android.com/tech/input/input-device-configuration-files.html http://source.android.com/tech/input/touch-devices.html idc(Input Device Configuration)為輸入設備配置文件,它包含設備具體的配置屬性,這些屬性影響輸入設備的行為。對於touch screen設備,總是需要一個idc文件來定義其行為。 Android基於輸入設備驅動匯報的事件類型和屬性來檢測和配置大部分輸入設備的能力。然而有些分類是模棱兩可的,如:多點觸摸屏(multi-touch touch screen)和touch pad都支持EV_ABS事件類型和ABS_MT_POSITION_X和ABS_MT_POSTION_Y事件,然而這兩類設備的使用是不同的,且不總是能自動判斷。所以,需要另外的信息來指示設備上報的pressrue和size信息的真正含義。因為,觸摸設備,特別是內嵌的touch screen,經常需要idc文件。 2. idc例子 我的觸摸屏設備的idc文件位於:/system/usr/idc目錄下,文件名為:Vendor_5697_Product_0008.idc,其內容如下: [cpp] view plaincopyprint? 1.# Filename:Vendor_5697_Product_0008.idc 2.# My TouchScreen Device configuration file. 3.# 4. 5.touch.deviceType = touchScreen 6.touch.orientationAware = 1 7. 8.keyboard.layout = Vendor_5697_Product_0008 9.keyboard.orientationAware = 1 10. 11.cursor.mode = navigation 12.cursor.orientationAware = 1 當然,在驅動程序中,驅動的name為:Vendor_5697_Product_0008,即input_dev結構的name成員值為:Vendor_5697_Product_0008。 3. idc訪問路徑及文件名規則 下列路徑被依次訪問: •/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 參考:http://source.android.com/tech/input/input-device-configuration-files.html http://source.android.com/tech/input/touch-devices.html