void InputManager::HandleEvent( SDL_Event& ev ) { if ( ev.type == SDL_MOUSEMOTION ) { HandleMouseMotionEvent( *reinterpret_cast<SDL_MouseMotionEvent*>( &ev ) ); } else if ( ev.type == SDL_MOUSEBUTTONDOWN ) { HandleMouseButtonEvent( *reinterpret_cast<SDL_MouseButtonEvent*>( &ev ), ButtonState::Pressed ); } else if ( ev.type == SDL_MOUSEBUTTONUP ) { HandleMouseButtonEvent( *reinterpret_cast<SDL_MouseButtonEvent*>( &ev ), ButtonState::Released ); } else if ( ev.type == SDL_MOUSEWHEEL ) { HandleMouseWheelEvent( ev.wheel ); } else if ( ev.type == SDL_KEYDOWN ) { HandleKeyboardEvent( ev.key, ButtonState::Pressed ); } else if ( ev.type == SDL_KEYUP ) { HandleKeyboardEvent( ev.key, ButtonState::Released ); } if ( FrameWork::GetGuiManager() && FrameWork::GetGuiManager()->GetFocusedInputArea() ) { HandleInputAreaEvent( ev ); } }
/***************************************************** ** ** BasicWidget --- OnMouseWheelEvent ** ******************************************************/ void BasicWidget::OnMouseWheelEvent( wxMouseEvent &event ) { //printf( "WHEEL in BasicWidget::onMouseWheelEvent %d - %d\n", event.GetX(), event.GetY() ); HandleMouseWheelEvent( event ); }