歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Android4.0鼠標右鍵返回功能

Android4.0鼠標右鍵返回功能。

在\frameworks\base\services\input\InputReader.cpp文件下修改

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