diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index 18977a81a3..ff7e1605b8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -242,34 +242,35 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis */ @Override public boolean dispatchKeyEvent(KeyEvent event) { - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event); + CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event); String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString(MfConstants.BLUETOOTH_NAME); if (!isPressEnd) { - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName); + CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName); } if (bluetoothName.equals("MINI_KEYBOARD")) { if (!isPressEnd) { isPressEnd = true; startPressTime = System.currentTimeMillis(); } - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction()); + CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction()); if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2 if (event.getAction() == KeyEvent.ACTION_DOWN) { pressADownTime = System.currentTimeMillis(); CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime); if ((pressADownTime - startPressTime) > 360 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) { if (isShowToast) { - ToastUtils.showShort("方块 A 按AB组合 -2 "); + ToastUtils.showShort("方块 A 按AB组合 +1 "); } - sendAcc(true, -2); + sendAcc(true, +1); isCombinationKey = 3; } if (isCombinationKey != 3 && isCombinationKey != 1) { if ((pressADownTime - startPressTime) > 1320) { if (isShowToast) { - ToastUtils.showShort("方块 长按A 无 操作 "); + ToastUtils.showShort("方块 长按A -2 "); } + sendAcc(true, -2); isCombinationKey = 2; } } @@ -299,17 +300,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime); if ((pressBDownTime - startPressTime) > 360 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) { if (isShowToast) { - ToastUtils.showShort("方块 B 按AB组合 "); + ToastUtils.showShort("方块 B 按AB组合 +1 "); } - sendAcc(true, -2); + sendAcc(true, +1); isCombinationKey = 3; } if (isCombinationKey != 3 && isCombinationKey != 1) { if ((pressBDownTime - startPressTime) > 1320) { if (isShowToast) { - ToastUtils.showShort("方块 长按B +1 "); + ToastUtils.showShort("方块 长按B 无操作 "); } - sendAcc(true, +1); isCombinationKey = 2; } }