Example #1
0
		virtual void CallEvent(FMouseEvent& e)
		{
			switch (e.type())
			{
			case fevents::kMouseMove:
				OnMouseMove(e);
				break;
			case fevents::kMouseButtonPress:
				OnMouseButtonPressed(e);
				break;
			case fevents::kMouseButtonRelease:
				OnMouseButtonReleased(e);
				break;
			default:
				break;
			}
		}
Example #2
0
void EventHandler::OnEvent (sf::Event* event)
{
	switch (event->type)
	{
		case sf::Event::Closed:
			//Window closed:
			OnClosed();
			break;
		case sf::Event::Resized:
			//Window resized:
			OnWindowResized (event->size);
		case sf::Event::GainedFocus:
			//Window gained focus:
			OnGainedFocus();
			break;
		case sf::Event::LostFocus:
			//Window lost focus:
			OnLostFocus();
			break;
			break;
		case sf::Event::TextEntered:
			//Text entered:
			OnTextEntered (event->text);
			break;
		case sf::Event::KeyPressed:
			//Key pressed:
			OnKeyPressed (event->key);
			break;
		case sf::Event::KeyReleased:
			//Key released:
			OnKeyReleased (event->key);
			break;
		case sf::Event::MouseWheelMoved:
			//Mouse wheel moved:
			OnMouseWheelMoved (event->mouseWheel);
			break;
		case sf::Event::MouseButtonPressed:
			//Mouse button pressed:
			OnMouseButtonPressed (event->mouseButton);
			break;
		case sf::Event::MouseButtonReleased:
			//Mouse button released:
			OnMouseButtonReleased(event->mouseButton);
			break;
		case sf::Event::MouseMoved:
			//Mouse moved:
			OnMouseMoved (event->mouseMove);
			break;
		case sf::Event::MouseEntered:
			//Mouse entered Window bounds:
			OnMouseEntered();
			break;
		case sf::Event::MouseLeft:
			//Mouse left Window bounds:
			OnMouseLeft();
			break;
		case sf::Event::JoystickButtonPressed:
			//Joystick button pressed:
			OnJoystickButtonPressed (event->joystickButton);
			break;
		case sf::Event::JoystickButtonReleased:
			//Joystick button released:
			OnJoystickButtonReleased(event->joystickButton);
			break;
		case sf::Event::JoystickMoved:
			//Joystick moved:
			OnJoystickMoved(event->joystickMove);
			break;
		case sf::Event::JoystickConnected:
			//Joystick connected:
			OnJoystickConnected (event->joystickConnect);
			break;
		case sf::Event::JoystickDisconnected:
			//Joystick disconnected:
			OnJoystickDisconnected (event->joystickConnect);
			break;
		

	}
}