Details post: 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...]
, Where
SCANCODE
Is a number,KEYCODE
Is defined in your specific keylayout file (android.keylayout.xxx
), And potential
FLAGS
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, *. KL file name shocould be the same with this input driver name, or generic. KL will be the target.