aosp 增加 home 键
查看具体键值
kernel/msm-4.9/include/uapi/linux/input-event-codes.h
和 frameworks/base/data/keyboards/Generic.kl
这个里面都可以看到 home 对应的是 172.
修改 dtsi
vim kernel/msm-4.9/arch/arm64/boot/dts/qcom/sq808-evk/qm215-qrd.dtsi
&soc {
gpio_keys {
home {
label = "home";
gpios = <&tlmm 127 0x1>;
linux,input-type = <1>;
linux,code = <172>;
debounce-interval = <15>;
linux,can-disable;
gpio-key,wakeup;
};
};
}
设置开机唤醒
vim frameworks/base/core/java/android/view/KeyEvent.java
/** @hide */
public static final boolean isWakeKey(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_MENU:
case KeyEvent.KEYCODE_WAKEUP:
case KeyEvent.KEYCODE_PAIRING:
case KeyEvent.KEYCODE_STEM_1:
case KeyEvent.KEYCODE_STEM_2:
case KeyEvent.KEYCODE_STEM_3:
case KeyEvent.KEYCODE_HOME:
return true;
}
return false;
}
参考:
android添加按键(二) 添加按键流程、出现问题
https://blog.csdn.net/lintao8613/article/details/82378798?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.no_search_link&spm=1001.2101.3001.4242.1
android8.1 添加物理按键流程
https://blog.csdn.net/tt11212/article/details/87608373
Android 10.0 framework层KeyEvent按键添加流程
https://blog.csdn.net/baidu_41666295/article/details/120262180?spm=1001.2101.3001.6650.13&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-13.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-13.no_search_link
安卓添加按键驱动
https://blog.csdn.net/jaych/article/details/38065497
android添加按键驱动,android按键驱动开发实例2(增加一个新按键)
https://blog.csdn.net/weixin_33379878/article/details/117618160?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link
Android 增加(键盘)按键
https://www.cnblogs.com/dyufei/p/6612790.html
Android系统input按键处理流程(从驱动到framework)
https://blog.csdn.net/jwq2011/article/details/51234811?spm=1001.2101.3001.6650.9&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-9.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-9.no_search_link
android gpio-keys 按键驱动分析(一) key layout文件
https://blog.csdn.net/clam_zxf/article/details/73849413?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-5.no_search_link&spm=1001.2101.3001.4242.4
[RK3288][Android6.0] 系统按键驱动流程分析
https://blog.csdn.net/kris_fei/article/details/77894406?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link
android 按键 驱动程序,android按键驱动研究.pdf
https://blog.csdn.net/weixin_42551260/article/details/117577179?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link
Android System 自定义KEY事件及驱动
https://blog.csdn.net/qq_31829527/article/details/105954489
android 按键处理流程,Android系统input按键处理流程(从驱动到framework)
https://blog.csdn.net/weixin_30727701/article/details/117601107?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link
2021-1-4 Android 添加新的键值并上报从驱动到上层
https://blog.csdn.net/qq_37858386/article/details/112170827
aw9523芯片按键失效问问题分析
https://ciellee.blog.csdn.net/article/details/101553530
Android中对标准内核的按键映射以及按键驱动
https://blog.csdn.net/xiaobaiing/article/details/45565123?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.no_search_link&spm=1001.2101.3001.4242.1
kernel按键上报键值的映射
https://blog.csdn.net/u013986340/article/details/101022488
Android系统按键上报流程及其转化
https://blog.csdn.net/weixin_44008788/article/details/118755916
AndroidR Input子系统(5)解析“.kl“文件
https://blog.csdn.net/qq_34211365/article/details/109687690
Android源码解析(二十八)-->电源开关机按键事件流程
https://blog.csdn.net/qq_23547831/article/details/51487978?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.no_search_link&spm=1001.2101.3001.4242.1
Android源码基础解析之电源开关机按键事件流程
https://blog.csdn.net/qq_35559358/article/details/78647031?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-5.no_search_link&spm=1001.2101.3001.4242.4
Android捕获home按键 以及实体键捕获
https://blog.csdn.net/qwertyuiop159158/article/details/52900065?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-1.no_search_link&spm=1001.2101.3001.4242.2
Android 读取按键及Touch Panel
https://blog.csdn.net/hgl868/article/details/6860116
AndroidQ 打通应用层到HAL层---(HAL模块实现)
https://blog.csdn.net/qq_34211365/article/details/105492973
Android源码解析(三十)-->触摸事件分发流程
https://blog.csdn.net/qq_23547831/article/details/51530671?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-12.no_search_link&spm=1001.2101.3001.4242.7
Android HOME键那些事
https://blog.csdn.net/imyfriend/article/details/8293399
Android 按下Home键
https://blog.csdn.net/greatdaocaoren/article/details/75009580
Android 监听Home键
https://www.jianshu.com/p/d215bc8e1b3d
【Android】Android处理Home键方法小结
https://www.cnblogs.com/rayray/p/3408179.html