MTK6757的OTG线连接鼠标后,鼠标右键改为返回功能

找到如下路径:
\frameworks\native\services\inputflinger\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;
}
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;
}

你可能感兴趣的:(MTK6757的OTG线连接鼠标后,鼠标右键改为返回功能)