欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

输入设备配置文件(.idc文件)

发布时间:2025/4/5 编程问答 36 豆豆
生活随笔 收集整理的这篇文章主要介绍了 输入设备配置文件(.idc文件) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

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?
  • # Filename:Vendor_5697_Product_0008.idc  
  • # My TouchScreen Device configuration file.  
  • #   
  •   
  • touch.deviceType = touchScreen  
  • touch.orientationAware = 1  
  •   
  • keyboard.layout = Vendor_5697_Product_0008  
  • keyboard.orientationAware = 1  
  •   
  • cursor.mode = navigation  
  • cursor.orientationAware = 1  
  • # Filename:Vendor_5697_Product_0008.idc # My TouchScreen Device configuration file. #touch.deviceType = touchScreen touch.orientationAware = 1keyboard.layout = Vendor_5697_Product_0008 keyboard.orientationAware = 1cursor.mode = navigation 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文件)的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。