From 3b5d2f8d8387b9184b49f940090e86e68aac279a Mon Sep 17 00:00:00 2001 From: zhaolinglan Date: Sat, 7 Jan 2023 21:37:18 +0800 Subject: [PATCH] modify code Signed-off-by: zhaolinglan --- services/adapter/keyboard/src/combination_key.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/adapter/keyboard/src/combination_key.cpp b/services/adapter/keyboard/src/combination_key.cpp index 6a6898343..936745f31 100644 --- a/services/adapter/keyboard/src/combination_key.cpp +++ b/services/adapter/keyboard/src/combination_key.cpp @@ -30,15 +30,19 @@ const std::map> COMBINATION_KEY_MAP bool CombinationKey::IsMatch(CombinationKeyFunction combinationKey, uint32_t state, int32_t pressedKeyNum) { + IMSA_HILOGD("combinationKey: %{public}d", combinationKey); auto expectedKeys = COMBINATION_KEY_MAP.find(combinationKey); if (expectedKeys == COMBINATION_KEY_MAP.end()) { + IMSA_HILOGD("known key function"); return false; } if (expectedKeys->second.size() != pressedKeyNum) { + IMSA_HILOGD("pressed key num not match"); return false; } for (const auto &key : expectedKeys->second) { if ((key & state) == 0) { + IMSA_HILOGD("key not match"); return false; } }