Problem with Input bucle

Hello all!!

We are making a “simple game” for the university and we are using SDL to control the inputs, and OpenGL to paint :).

Well, our main problem is with the input bucle. I suppose that we are doing something weird but i can’t figure it out. The problem is that if we press the “C” Key while we are moving the mouse. The key “C” is not recognized. And viceversa, If we are pressing the “C” key and we move the mouse the mouse is not responding (application dont enter to the event mousemotion). Here is the messy code…

void Input::Update(void)
{
	while (SDL_PollEvent(&m_event));
			{
				//AIXO COMPROVA SI LI DONO A LA TECLA ESCAPE O A LA X DE LA FINESTRA
				if (m_event.type == SDL_QUIT || m_event.key.keysym.sym== SDLK_ESCAPE)
					Cruilla::GetInstance()->m_running = false;

				if (m_event.key.state == SDL_PRESSED  && m_event.key.keysym.sym == SDLK_c && CTimer::GetInstance()->IsEndInputTimer("Camera_activa",0.2))
					if (m_activada) m_activada=false; else m_activada = true;



				if (m_activada)
				{	if (m_event.type == SDL_MOUSEMOTION)
					{
						//cout<<"X "<< m_event.motion.x<< " Y "<< m_event.motion.y<< " |   RELATIVES  X "<<m_event.motion.xrel << " Y "<<m_event.motion.yrel<<"\n"<<flush;
						Camera::GetInstance()->CalculPosicio(m_event.motion.x,m_event.motion.y);
					}
				}
			}
}

Some clarification this: CTimer::GetInstance()->IsEndInputTimer(“Camera_activa”,0.2)) is a input timer, so it returns true after 0.2, this prevents multiples clicks.

The main bucle of the “game” is:

While (m_running)
{
        Updateallclasses
        Renderall
}

Can anyone with more experience give us some help please?:oops:
P.D. Sorry for my poor english :roll: