[6.3.0][蘑方优化] M1&B1&B2车型禁用左右变道
This commit is contained in:
@@ -386,6 +386,11 @@ internal class MoFangCommandExecutor {
|
||||
|
||||
|
||||
fun handleSingleClick(keycode: Int) {
|
||||
val isEnabled = CallerDevaToolsManager.mofang()?.isEnabled(1, keycode) ?: true
|
||||
if (!isEnabled) {
|
||||
Log.d(TAG, "输入 -> 单击 -> 按键:${keycode}被禁用...")
|
||||
return
|
||||
}
|
||||
if (keycode == KeyEvent.KEYCODE_A) {
|
||||
Log.d(TAG, "--- 单机键A --- 加速度每隔500ms减少1 ----")
|
||||
handler.removeMessages(MSG_WHAT_KEY_CODE_A)
|
||||
@@ -443,6 +448,11 @@ internal class MoFangCommandExecutor {
|
||||
}
|
||||
|
||||
fun handleLongClick(keyCode: Int) {
|
||||
val isEnabled = CallerDevaToolsManager.mofang()?.isEnabled(2, keyCode) ?: true
|
||||
if (!isEnabled) {
|
||||
Log.d(TAG, "输入 -> 长按 -> 按键:${keyCode}被禁用...")
|
||||
return
|
||||
}
|
||||
if (keyCode == KeyEvent.KEYCODE_A) {
|
||||
Log.d(TAG, "---- 长按键A ---- 加速度每隔500毫秒,减小2 ---")
|
||||
handler.removeMessages(MSG_WHAT_KEY_CODE_AL)
|
||||
@@ -477,6 +487,11 @@ internal class MoFangCommandExecutor {
|
||||
}
|
||||
|
||||
fun handleCombineClick(vararg keyCodes: Int) {
|
||||
val isEnabled = CallerDevaToolsManager.mofang()?.isEnabled(3, *keyCodes) ?: true
|
||||
if (!isEnabled) {
|
||||
Log.d(TAG, "输入 -> 组合 -> 按键:${keyCodes.joinToString(",")}被禁用...")
|
||||
return
|
||||
}
|
||||
if (isCombineEqual(KeyEvent.KEYCODE_A, KeyEvent.KEYCODE_B, *keyCodes)) {
|
||||
//AB组合键,加速度每隔500毫秒,增加1
|
||||
Log.d(TAG, "---- 组合键AB ---- 按下, 加速度加1 ----")
|
||||
|
||||
@@ -17,9 +17,12 @@ import androidx.lifecycle.*
|
||||
import com.mogo.core.mofang.connect.MoFangManager
|
||||
import com.mogo.core.mofang.connect.device.*
|
||||
import com.mogo.core.mofang.connect.listener.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.*
|
||||
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider.OnMoFangStatusListener
|
||||
import com.mogo.eagle.core.utilcode.floating.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.getMisChannelCode
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
@@ -320,4 +323,23 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
|
||||
MoFangAnalyticUtils.track(EVENT_MOFANG_CONNECT, mutableMapOf(EVENT_MOFANG_CONNECT_PARAMS_DISCONNECT_SLEEP to "${System.currentTimeMillis()}"))
|
||||
linkedLog.record(mapOf("callback" to "onBluetoothKeyboardAbnormalDisconnected:$status"))
|
||||
}
|
||||
|
||||
override fun isEnabled(inputType: Int, vararg keyCodes: Int): Boolean {
|
||||
val mode = FunctionBuildConfig.appIdentityMode
|
||||
val channel = AppIdentityModeUtils.getMisChannelCode(mode)
|
||||
val isB1OrB2 = (channel == 11 || channel == 15)
|
||||
val isM1 = AppIdentityModeUtils.isM1(mode)
|
||||
if (isB1OrB2 || isM1) {
|
||||
if (inputType == 1 && keyCodes.size == 1) {
|
||||
// 单击
|
||||
val code = keyCodes[0]
|
||||
if (code == KeyEvent.KEYCODE_C || code == KeyEvent.KEYCODE_D) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user