From 52bc276157ce2dc18a7a9a5e4c09007ac95e9b81 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Wed, 1 Feb 2023 16:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=AD=94=E6=96=B9=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/main/MainLauncherActivity.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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; } }