void EventHandler::HandleEvent(const SDL_Event& event) { switch (event.type) { case SDL_KEYDOWN: OnKeyboardEvent(event.key); break; case SDL_KEYUP: OnKeyboardEvent(event.key); break; case SDL_MOUSEMOTION: OnMouseMotionEvent(event.motion); break; case SDL_JOYAXISMOTION: OnJoyAxisEvent(event.jaxis); break; case SDL_MOUSEBUTTONDOWN: OnMouseButtonEvent(event.button); break; case SDL_MOUSEBUTTONUP: OnMouseButtonEvent(event.button); break; // .... } }
void EventHandler::HandleEvent(const SDL_Event& event) { switch (event.type) { case SDL_QUIT: OnQuit(); break; case SDL_KEYUP: case SDL_KEYDOWN: OnKeyboardEvent(event.key); break; case SDL_MOUSEMOTION: OnMouseMotionEvent(event.motion); break; case SDL_JOYAXISMOTION: OnJoystickAxisEvent(event.jaxis); break; } }
void CInputAdapter::OnNotify( CORE::CNotifier* notifier , const CORE::CEvent& eventid , CORE::CICloneable* eventdata ) {GUCEF_TRACE; if ( NULL != m_rocketContext ) { INPUT::CAbstractInputDevice* inputDevice = static_cast< INPUT::CAbstractInputDevice* >( notifier ); if ( inputDevice->IsDeviceType( INPUT::CMouse::DeviceType ) ) { OnMouseEvent( static_cast< INPUT::CMouse* >( notifier ) , eventid , eventdata ); } else if ( inputDevice->IsDeviceType( INPUT::CKeyboard::DeviceType ) ) { OnKeyboardEvent( static_cast< INPUT::CKeyboard* >( notifier ) , eventid , eventdata ); } } }