在Android下实现鼠标右键返回

接上USB鼠标后,按鼠标右键没有返回,可按如下修改实现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_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;
原文链接: http://www.linuxidc.com/Linux/2012-07/65490.htm

你可能感兴趣的:(ANDROID)