android4.0.3--开发板--鼠标--右键back功能

来源:互联网 发布:手机淘宝如何查看积分 编辑:程序博客网 时间:2024/05/16 14:17
  1.  在\frameworks\base\services\input\InputReader.cpp文件下修改

  2. uint32_t CursorButtonAccumulator::getButtonState() const {
  3.     uint32_t result = 0;
  4.     if (mBtnLeft) {
  5.         result |= AMOTION_EVENT_BUTTON_PRIMARY;
  6.     }
  7.     if (mBtnRight) {
  8.         result |= AMOTION_EVENT_BUTTON_BACK;
  9.     }
  10.     if (mBtnMiddle) {
  11.         result |= AMOTION_EVENT_BUTTON_TERTIARY;
  12.     }
  13.     if (mBtnBack || mBtnSide) {
  14.         result |= AMOTION_EVENT_BUTTON_BACK;
  15.     }
  16.     if (mBtnForward || mBtnExtra) {
  17.         result |= AMOTION_EVENT_BUTTON_FORWARD;
  18.     }
  19.     return result;

注意:这个cpp文件是可执行的,通过vi和gedit都不能成功修改,所以要么先将权限去掉(猜想),要么使用vim修改

原创粉丝点击