Android Key Layout Map

来源:互联网 发布:爵迹 知乎 编辑:程序博客网 时间:2024/05/21 19:27

详细内容转贴:http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html

 

Key layout maps are installed in /system/usr/keylayout and /data/usr/keylayout.

 

Key layout maps are stored on the device as UTF-8 text files and have the following characteristics:

  • Comments: The pound symbol (#) denotes a comment and everything after the pound symbol on a line is ignored.
  • Whitespace: All empty lines are ignored.
  • Key definitions: Key definitions follow the syntax key SCANCODE KEYCODE [FLAGS...], whereSCANCODE is a number, KEYCODE is defined in your specific keylayout file (android.keylayout.xxx), and potentialFLAGS are defined as follows:
    • SHIFT: While pressed, the shift key modifier is set
    • ALT: While pressed, the alt key modifier is set
    • CAPS: While pressed, the caps lock key modifier is set
    • WAKE: When this key is pressed while the device is asleep, the device will wake up and the key event gets sent to the app.
    • WAKE_DROPPED: When this key is pressed while the device is asleep, the device will wake up and the key event does not get sent to the app.

 In ICS, Generic.kl will be used if no specific keypad layout file, the *.kl file name should be the same with this input driver name, or Generic.kl will be the target.

原创粉丝点击