android 添加一個按鍵鍵值【轉】

本文轉載自:http://blog.csdn.net/u012719256/article/details/52526046css

1.frameworks/base/data/keyboards/Generic.kl (鍵盤佈局文件添加鍵值映射,這裏的鍵值對應kernel裏面的鍵值,按鍵名字對應上層keycodes.h裏面定義的按鍵名字) 
key 497 GESTURE_WAKELOCKjava

2.frameworks/base/core/res/res/values/attrs.xmlandroid

<enum name="KEYCODE_GESTURE_WAKELOCK" value="267" 
  • 1

3.frameworks\native\include\android\keycodes.hapi

 AKEYCODE_GESTURE_WAKEUP =267 
  • 1

4.frameworks\native\include\input\InputEventLabels.hmarkdown

DEFINE_KEYCODE(GESTURE_WAKELOCK) 
  • 1

5.frameworks/base/core/java/android/view/KeyEvent.java 
(1)添加鍵值佈局

public static final int KEYCODE_GESTURE_WAKELOCK = 267; 
  • 1

(2)是否爲系統按鍵或者喚醒功能按鍵post

isSystemKey
    isWakeKey
  • 1
  • 2

6.frameworks/base/api/current.txt 
frameworks/base/api/system-current.txtspa

相關文章
相關標籤/搜索