예제 #1
0
 void Form::keyEventInternal(Keyboard::KeyEvent evt, int key)
 {
     std::vector<Form*>::const_iterator it;
     for (it = __forms.begin(); it < __forms.end(); it++)
     {
         Form* form = *it;
         if (form->isEnabled())
         {
             form->keyEvent(evt, key);
         }
     }
 }
예제 #2
0
파일: Form.cpp 프로젝트: 5guo/GamePlay
bool Form::keyEventInternal(Keyboard::KeyEvent evt, int key)
{
    size_t size = __forms.size();
    for (size_t i = 0; i < size; ++i)
    {
        Form* form = __forms[i];
        GP_ASSERT(form);
        if (form->isEnabled() && form->isVisible() && form->hasFocus() && !form->_isGamepad)
        {
            if (form->keyEvent(evt, key))
                return true;
        }
    }
    return false;
}