Fusion.Drivers.Input.Gamepad.Update C# (CSharp) Method

Update() static private method

static private Update ( ) : void
return void
		internal static void Update()
		{
			foreach (var gamepad in gamepads) {
				gamepad.UpdateState();
			}
		}
	}

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Frame
        /// </summary>
        internal void UpdateInput()
        {
            if (Game.GraphicsDevice.Display.Window != null)
            {
                if (Game.IsActive)
                {
                    System.Drawing.Rectangle rect = Game.GraphicsDevice.Display.Window.ClientRectangle;

                    if (IsMouseCentered)
                    {
                        Forms.Cursor.Position = Game.GraphicsDevice.Display.Window.PointToScreen(new Drawing.Point(rect.Width / 2, rect.Height / 2));
                    }

                    if (IsMouseClipped)
                    {
                        Forms.Cursor.Clip = Game.GraphicsDevice.Display.Window.RectangleToScreen(rect);
                    }
                    else
                    {
                        Forms.Cursor.Clip = new Drawing.Rectangle(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue);
                    }

                    SetCursorVisibility(!IsMouseHidden);
                }
                else
                {
                    Forms.Cursor.Clip   = new Drawing.Rectangle(int.MinValue, int.MinValue, int.MaxValue, int.MaxValue);
                    RelativeMouseOffset = Vector2.Zero;
                    SetCursorVisibility(true);

                    RemoveAllPressedKeys();
                }
            }

            Gamepad.Update();
        }