From dc81b93daefdfab7ec6a0f356d9f7e82aacfb961 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 10 Apr 2024 09:35:14 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E5=BD=95=E9=9F=B3=E5=92=8C?= =?utf8?q?=E5=A4=A9=E6=B0=94=E8=A7=86=E5=9B=BE=E7=9A=84=E6=8C=89=E9=94=AE?= =?utf8?q?=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/record/src/RecordingPresenter.cpp | 3 ++- .../fd230app/nativeui/weather/src/MainWeatherPresenter.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp index f85bd5561..a2fb28277 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp @@ -242,8 +242,9 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RecordingPresenter::OnKeyAct"); uint16 keyID = event.GetKeyId(); + uint16_t keyState = event.GetState(); // 如果是power键就返回上一级 - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) { uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); NativeAbility::GetInstance().ChangeSlice(preSlice); diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp index 43bf11f93..6d0b00d87 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp @@ -4,6 +4,8 @@ #include "NativeAbility.h" #include "weather/include/MainWeatherPresenter.h" #include "common/key_code.h" +#include "common/key_code.h" +#include namespace OHOS { @@ -83,8 +85,9 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SettingPresenter::OnKeyAct"); uint16 keyID = event.GetKeyId(); + uint16_t keyState = event.GetState(); // 如果是power键就返回上一级 - if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER)) + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) { uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); NativeAbility::GetInstance().ChangeSlice(preSlice); -- 2.17.1