From 1ee7f722765cfc8c2c50e941f35cbc07ddf1b4e1 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 18 Sep 2013 17:02:32 +0800 Subject: [PATCH] Modify handle_key_input function for responding the onKeyReleased --- cocos2dx/platform/android/nativeactivity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/android/nativeactivity.cpp b/cocos2dx/platform/android/nativeactivity.cpp index 323cb7811f..231fcf0ad4 100644 --- a/cocos2dx/platform/android/nativeactivity.cpp +++ b/cocos2dx/platform/android/nativeactivity.cpp @@ -402,16 +402,16 @@ static int32_t handle_key_input(AInputEvent *event) { cocos2d::KeyboardEvent event; event._keyCode = cocos2d::KeyboardEvent::KeyCode::KEY_BACKSPACE; + event._isPressed = false; cocos2d::EventDispatcher::getInstance()->dispatchEvent(&event); - LOGI("AKEYCODE_BACK"); } return 1; case AKEYCODE_MENU: { cocos2d::KeyboardEvent event; event._keyCode = cocos2d::KeyboardEvent::KeyCode::KEY_MENU; + event._isPressed = false; cocos2d::EventDispatcher::getInstance()->dispatchEvent(&event); - LOGI("AKEYCODE_MENU"); } return 1; default: