android修改鼠标事件

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

uint32_t CursorButtonAccumulator::getButtonState() const {
    uint32_t result = 0;
    if (mBtnLeft) {
        result |= AMOTION_EVENT_BUTTON_PRIMARY;
    }
    if (mBtnRight) {
       //result |= AMOTION_EVENT_BUTTON_SECONDARY;
       result |= AMOTION_EVENT_BUTTON_BACK; //如将鼠标右键修改成back功能
     }
    if (mBtnMiddle) {
        result |= AMOTION_EVENT_BUTTON_TERTIARY;
    }
        if (mBtnBack || mBtnSide) {
        result |= AMOTION_EVENT_BUTTON_BACK;
    }
       if (mBtnForward || mBtnExtra) {
       result |= AMOTION_EVENT_BUTTON_FORWARD;
    }
    return result;
}

你可能感兴趣的:(Android)