Android4.0鼠标右键返回功能

Android4.0鼠标右键返回功能。

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

uint32_t CursorButtonAccumulator::getButtonState() const {
    uint32_t result = 0;
    if (mBtnLeft) {
        result |= AMOTION_EVENT_BUTTON_PRIMARY;
    }
    if (mBtnRight) {
		/******modify by lizm 2013-05-31**********/
       // result |= AMOTION_EVENT_BUTTON_SECONDARY;
		result |= AMOTION_EVENT_BUTTON_BACK;
		/******modify by lizm end******/
    }
    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;
}



 

本篇文章来源于 Linux公社网站(www.linuxidc.com)  原文链接:http://www.linuxidc.com/Linux/2012-07/65490.htm

你可能感兴趣的:(Android4.0鼠标右键返回功能)