예제 #1
0
 JNIEXPORT jboolean JNICALL Java_org_CrossApp_lib_CrossAppRenderer_nativeKeyDown(JNIEnv * env, jobject thiz, jint keyCode) {
     CAApplication* pDirector = CAApplication::getApplication();
     switch (keyCode) {
         case KEYCODE_BACK:
               if (pDirector->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked))
                 return JNI_TRUE;
             break;
         case KEYCODE_MENU:
             if (pDirector->getKeypadDispatcher()->dispatchKeypadMSG(kTypeMenuClicked))
                 return JNI_TRUE;
             break;
         default:
             return JNI_FALSE;
     }
     return JNI_FALSE;
 }
예제 #2
0
/// isKeypadEnabled setter
void CAViewController::setKeypadEnabled(bool enabled)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
    if (enabled != m_bKeypadEnabled)
    {
        m_bKeypadEnabled = enabled;
        
        CAApplication* pDirector = CAApplication::getApplication();
        if (enabled)
        {
            pDirector->getKeypadDispatcher()->addDelegate(this);
        }
        else
        {
            pDirector->getKeypadDispatcher()->removeDelegate(this);
        }
    }
#endif
}
예제 #3
0
CAViewController::~CAViewController()
{
    m_pView->setViewDelegate(NULL);
    CC_SAFE_RELEASE_NULL(m_pView);
    CC_SAFE_RELEASE_NULL(m_pTabBarItem);
    CC_SAFE_RELEASE_NULL(m_pNavigationBarItem);
    CAApplication* pDirector = CAApplication::getApplication();
    if (m_bKeypadEnabled)
    {
        pDirector->getKeypadDispatcher()->removeDelegate(this);
    }
}