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;

相关内容

    暂无相关文章