This article was reproduced from: http://blog.csdn.net/u013308744/article/details/49274069
First look at the KL file of touchscreen
# Copyright (c), the Linux Foundation. All rights reserved.
#
# redistribution and use in source and binary forms, with or without
# modification, is permitted provided that the following conditions is
# Met:
# * Redistributions of source code must retain the above copyright
# Notice, this list of conditions and the following disclaimer.
# * redistributions in binary form must reproduce the above
# copyright Notice, this list of conditions and the following
# Disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of the Linux Foundation nor the names of its
# Contributors May is used to endorse or promote products derived
# from this software without specific prior written permission.
#
# This software is provided ' as is ' and any EXPRESS OR implied
# warranties, including, but not LIMITED to, the implied warranties of
# merchantability, FITNESS for A particular PURPOSE and non-infringement
# is disclaimed. In NO EVENT shall the COPYRIGHT OWNER OR CONTRIBUTORS
# be liable for any DIRECT, INDIRECT, incidental, special, exemplary, OR
# consequential damages (including, but not LIMITED to, procurement of
# substitute GOODS OR SERVICES; LOSS of Use, DATA, OR profits; OR
# business interruption) however caused and on any theory of liability,
# WHETHER in contract, STRICT liability, OR TORT (including negligence
# OR OTHERWISE) arising in any-out-of-the----software, even
# IF advised of the possibility of SUCH DAMAGE.
Key 158 back VIRTUAL WAKE
Key 102 HOME VIRTUAL WAKE
Key 580 App_switch VIRTUAL WAKE
Key Gesture_double_click VIRTUAL WAKE
Key Gesture_c VIRTUAL WAKE
Key Gesture_e VIRTUAL WAKE
Key gesture_s VIRTUAL WAKE
Key Gesture_v VIRTUAL WAKE
Key Gesture_w VIRTUAL WAKE
Key Gesture_z VIRTUAL WAKE
So what's the use of this KL, as we all know, Android kernel and the framework are different two layers, that is to say, kernel know
The key value is 158 such as this number, this 158 is scankode, it will report to the framework when it only reported such a number, but the framework does not know what this number, so the framework needs to parse the KL file, map up, So kernel to the value of the time to know exactly what the key, that is, convert Scancode 158 into Keycodelabel that is back, and then turn to 4 this keycode
First of all
Key 580 App_switch VIRTUAL WAKE
Here the 580 is Scancode, converted to app_switch this Keycodelabel
In the InputEventLabels.h.
Define_keycode (App_switch),
#define DEFINE_KEYCODE (Key) {#key, akeycode_# #key}
Here's a mosaic of Akeycode_app_switch.
Keycodes.h (native\include\android): Akeycode_app_switch = 187,
Keyevent.java (Base\core\java\android\view): public static final int keycode_app_switch = 187;
And then it becomes keycode 187.
The role of the Android KL file "Go"