Input Device Configuration Files - http://source.android.com

本文介绍了Android系统中输入设备配置文件(.idc文件)的作用及其使用场景,详细解释了配置文件的位置、语法、常见属性等内容,并提供了示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Input Device Configuration Files


Input device configuration files (.idc files) contain device-specific configuration properties that affect the behavior of input devices.

Input device configuration files are typically not necessary for standard peripherals such as HID keyboards and mice since the default system behavior usually ensures that they will work out of the box. On the other hand, built-in embedded devices, particularly touch screens, almost always require input device configuration files to specify their behavior.

Rationale


Android automatically detects and configures most input device capabilities based on the event types and properties that are reported by the associated Linux kernel input device driver.

For example, if an input device supports the EV_REL event type and codes REL_X and REL_Y as well as theEV_KEY event type and BTN_MOUSE, then Android will classify the input device as a mouse. The default behavior for a mouse is to present an on-screen cursor which tracks the mouse's movements and simulates touches when the mouse is clicked. Although the mouse can be configured differently, the default behavior is usually sufficient for standard mouse peripherals.

Certain classes of input devices are more ambiguous. For example, multi-touch touch screens and touch pads both support the EV_ABS event type and codes ABS_MT_POSITION_X and ABS_MT_POSITION_Y at a minimum. However, the intended uses of these devices are quite different and cannot always be determined automatically. Also, additional information is required to make sense of the pressure and size information reported by touch devices. Hence touch devices, especially built-in touch screens, usually need IDC files.

Location


Input device configuration files are located by USB vendor, product (and optionally version) id or by input device name.

The following paths are consulted in order.

  • /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

When constructing a file path that contains the device name, all characters in the device name other than '0'-'9', 'a'-'z', 'A'-'Z', '-' or '_' are replaced by '_'.

Syntax


An input device configuration file is a plain text file consisting of property assignments and comments.

Properties

Property assignments each consist of a property name, an =, a property value, and a new line. Like this:

property = value

Property names are non-empty literal text identifiers. They must not contain whitespace. Each components of the input system defines a set of properties that are used to configure its function.

Property values are non-empty string literals, integers or floating point numbers. They must not contain whitespace or the reserved characters \ or ".

Property names and values are case-sensitive.

Comments

Comment lines begin with '#' and continue to the end of the line. Like this:

# A comment!

Blank lines are ignored.

Example

# This is an example of an input device configuration file.
# It might be used to describe the characteristics of a built-in touch screen.

# This is an internal device, not an external peripheral attached to the USB
# or Bluetooth bus.
device.internal = 1

# The device should behave as a touch screen, which uses the same orientation
# as the built-in display.
touch.deviceType = touchScreen
touch.orientationAware = 1

# Additional calibration properties...
# etc...

Common Properties


The following properties are common to all input device classes.

Refer to the documentation of each input device class for information about the special properties used by each class.

device.internal

Definition: device.internal = 0 | 1

Specifies whether the input device is an internal built-in component as opposed to an externally attached (most likely removable) peripheral.

  • If the value is 0, the device is external.

  • If the value is 1, the device is internal.

  • If the value is not specified, the default value is 0 for all devices on the USB (BUS_USB) or Bluetooth (BUS_BLUETOOTH) bus, 1 otherwise.

This property determines default policy decisions regarding wake events.

Internal input devices generally do not wake the display from sleep unless explicitly configured to do so in the key layout file or in a hardcoded policy rule. This distinction prevents key presses and touches from spuriously waking up your phone when it is in your pocket. Usually there are only a small handful of wake keys defined.

Conversely, external input devices usually wake the device more aggressively because they are assumed to be turned off or not plugged in during transport. For example, pressing any key on an external keyboard is a good indicator that the user wants the device to wake up and respond.

It is important to ensure that the value of the device.internal property is set correctly for all internal input devices.

Validation


Make sure to validate your input device configuration files using the Validate Keymaps tool.


From: https://source.android.com/devices/tech/input/input-device-configuration-files.html


0]**** Clean-only build of configuration Debug for project empty_mspm0g3507_nortos_ticlang **** [1]"F:\\ccs\\ccs\\utils\\bin\\gmake" -k -j 16 clean -O [2]**** Build of configuration Debug for project empty_mspm0g3507_nortos_ticlang **** [3]"F:\\ccs\\ccs\\utils\\bin\\gmake" -k -j 16 all -O [4]Building file: "../empty_mspm0g3507.syscfg" [5]Invoking: SysConfig [6]"F:/ccs/ccs/utils/sysconfig_1.24.0/sysconfig_cli.bat" --script "F:/ccS555/empty_mspm0g3507_nortos_ticlang/empty_mspm0g3507.syscfg" -o "syscfg" -s "C:/TI/mspm0_sdk_2_05_01_00/.metadata/product.json" -b "/ti/boards/LP_MSPM0G3507" --context "system" --compiler ticlang [7]Running script... [8]Validating... [9]info: GPIO_GRP_18(/ti/driverlib/GPIO) associatedPins[0].initialValue: Tip: LED PA0 on Launchpads is Active Low. [10]info: TIMER_0(/ti/driverlib/TIMER): Peripheral does not retain register contents in STOP or STANDBY modes. User should take care to save and restore register configuration in application. See Retention Configuration section for more details. [11]Generating Code (empty_mspm0g3507.syscfg)... [12]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device_linker.cmd... [13]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device.opt... [14]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device.cmd.genlibs... [15]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\ti_msp_dl_config.c... [16]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\ti_msp_dl_config.h... [17]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\Event.dot... [18]Finished building: "../empty_mspm0g3507.syscfg" [19]Building file: "../empty_mspm0g3507.c" [20]Invoking: Arm Compiler [21]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -I"/source/third_party/CMSIS/Core/Include" -I"/source" -gdwarf-3 -MMD -MP -MF"empty_mspm0g3507.d_raw" -MT".o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"empty_mspm0g3507.o" "../empty_mspm0g3507.c" [22]Building file: "syscfg/ti_msp_dl_config.c" [23]Invoking: Arm Compiler [24]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -gdwarf-3 -MMD -MP -MF"syscfg/ti_msp_dl_config.d_raw" -MT"syscfg/ti_msp_dl_config.o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"syscfg/ti_msp_dl_config.o" "syscfg/ti_msp_dl_config.c" [25]../empty_mspm0g3507.c:4:10: fatal error: 'ti/devices/msp/m0p/dl/sys/dl_system.h' file not found [26] 4 | #include <ti/devices/msp/m0p/dl/sys/dl_system.h> // 修复后的包含路径 [27] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [28]1 error generated. [29]gmake: *** [subdir_rules.mk:11: empty_mspm0g3507.o] Error 1 [30]Finished building: "syscfg/ti_msp_dl_config.c" [31]Building file: "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [32]Invoking: Arm Compiler [33]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -gdwarf-3 -MMD -MP -MF"startup_mspm0g350x_ticlang.d_raw" -MT"startup_mspm0g350x_ticlang.o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"startup_mspm0g350x_ticlang.o" "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [34]Finished building: "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [35]gmake: Target 'all' not remade because of errors. [36]**** Build Finished ****
最新发布
08-02
[0]**** Build of configuration Debug for project empty_mspm0g3507_nortos_ticlang **** [1]"F:\\ccs\\ccs\\utils\\bin\\gmake" -k -j 16 all -O [2]Building file: "../empty_mspm0g3507.syscfg" [3]Invoking: SysConfig [4]"F:/ccs/ccs/utils/sysconfig_1.24.0/sysconfig_cli.bat" --script "F:/ccS555/empty_mspm0g3507_nortos_ticlang/empty_mspm0g3507.syscfg" -o "syscfg" -s "C:/TI/mspm0_sdk_2_05_01_00/.metadata/product.json" -b "/ti/boards/LP_MSPM0G3507" --context "system" --compiler ticlang [5]Running script... [6]Validating... [7]info: GPIO_GRP_18(/ti/driverlib/GPIO) associatedPins[0].initialValue: Tip: LED PA0 on Launchpads is Active Low. [8]info: TIMER_0(/ti/driverlib/TIMER): Peripheral does not retain register contents in STOP or STANDBY modes. User should take care to save and restore register configuration in application. See Retention Configuration section for more details. [9]Generating Code (empty_mspm0g3507.syscfg)... [10]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device_linker.cmd... [11]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device.opt... [12]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\device.cmd.genlibs... [13]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\ti_msp_dl_config.c... [14]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\ti_msp_dl_config.h... [15]Writing F:\ccS555\empty_mspm0g3507_nortos_ticlang\Debug\syscfg\Event.dot... [16]Finished building: "../empty_mspm0g3507.syscfg" [17]Building file: "../empty_mspm0g3507.c" [18]Invoking: Arm Compiler [19]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -gdwarf-3 -MMD -MP -MF"empty_mspm0g3507.d_raw" -MT"empty_mspm0g3507.o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"empty_mspm0g3507.o" "../empty_mspm0g3507.c" [20]Building file: "syscfg/ti_msp_dl_config.c" [21]Invoking: Arm Compiler [22]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -gdwarf-3 -MMD -MP -MF"syscfg/ti_msp_dl_config.d_raw" -MT"syscfg/ti_msp_dl_config.o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"syscfg/ti_msp_dl_config.o" "syscfg/ti_msp_dl_config.c" [23]../empty_mspm0g3507.c:4:10: fatal error: 'dl/sys/dl_system.h' file not found [24] 4 | #include <dl/sys/dl_system.h> // 包含SystemCoreClock [25] | ^~~~~~~~~~~~~~~~~~~~ [26]1 error generated. [27]gmake: *** [subdir_rules.mk:11: empty_mspm0g3507.o] Error 1 [28]Finished building: "syscfg/ti_msp_dl_config.c" [29]Building file: "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [30]Invoking: Arm Compiler [31]"F:/ccs/ccs/tools/compiler/ti-cgt-armllvm_4.0.3.LTS/bin/tiarmclang.exe" -c @"syscfg/device.opt" -march=thumbv6m -mcpu=cortex-m0plus -mfloat-abi=soft -mlittle-endian -mthumb -O2 -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug" -I"C:/TI/mspm0_sdk_2_05_01_00/source/third_party/CMSIS/Core/Include" -I"C:/TI/mspm0_sdk_2_05_01_00/source" -gdwarf-3 -MMD -MP -MF"startup_mspm0g350x_ticlang.d_raw" -MT"startup_mspm0g350x_ticlang.o" -I"F:/ccS555/empty_mspm0g3507_nortos_ticlang/Debug/syscfg" @"syscfg/device.opt" -o"startup_mspm0g350x_ticlang.o" "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [32]Finished building: "C:/TI/mspm0_sdk_2_05_01_00/source/ti/devices/msp/m0p/startup_system_files/ticlang/startup_mspm0g350x_ticlang.c" [33]gmake: Target 'all' not remade because of errors. [34]**** Build Finished ****
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值