private void OnInputMessageReceived(object sender, InputMessageEventArgs e) { if (!IsGameViewActive) { return; } Point2D getPositionInPanel() { var pos = e.Message.Value.MousePosition; pos.X -= _frame.X; pos.Y -= _frame.Y; return(pos); } switch (e.Message.MessageType) { case InputMessageType.MouseLeftButtonDown: case InputMessageType.MouseLeftButtonUp: case InputMessageType.MouseMiddleButtonDown: case InputMessageType.MouseMiddleButtonUp: case InputMessageType.MouseRightButtonDown: case InputMessageType.MouseRightButtonUp: e = new InputMessageEventArgs(InputMessage.CreateMouseButton( e.Message.MessageType, getPositionInPanel())); break; case InputMessageType.MouseMove: e = new InputMessageEventArgs(InputMessage.CreateMouseMove( getPositionInPanel())); break; } InputMessageReceived?.Invoke(this, e); }
private void RaiseInputMessageReceived(InputMessageEventArgs args) { InputMessageReceived?.Invoke(this, args); }