键盘布局文件: qwerty.kcm
驱动键值变成android KeyCode的过程:
qwerty.kcm: scaleCode -> 键名
KeycodeLables.h: 键名->Keycode
特殊符号映射: qwerty.kl
将SYM键改成输入特殊符号:
在qwerty.kcm增加
SYM 0xEF01 0xEF01 0xEF01 0xEF01 0xEF01 0xEF01
系统根据在QwertyKeyListener中的下面映射关系弹出包括这些特殊字符的CharacterPickerDialog
PICKER_SETS.put(KeyCharacterMap.PICKER_DIALOG_INPUT,
"\u2026\u00A5\u2022\u00AE\u00A9\u00B1[]{}\\|");
//注: public static final char PICKER_DIALOG_INPUT = '\uEF01';
新增键:
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
// native/include/android/keycodes.h
// frameworks/base/include/ui/KeycodeLabels.h
// external/webkit/WebKit/android/plugins/ANPKeyCodes.h
// tools/puppet_master/PuppetMaster/nav_keys.py
// frameworks/base/core/res/res/values/attrs.xml
// commands/monkey/Monkey.java
// emulator?
//
// Also Android currently does not reserve code ranges for vendor-
// specific key codes. If you have new key codes to have, you
// MUST contribute a patch to the open source project to define
// those new codes. This is intended to maintain a consistent
// set of key code definitions across all Android devices.