|
@@ -6,8 +6,6 @@ This static class holds all the data required to handle inputs. It takes care of
|
|
|
|
|
|
Read the [source code](https://github.com/Apostolique/Apos.Input/blob/master/Source/InputHelper.cs).
|
|
Read the [source code](https://github.com/Apostolique/Apos.Input/blob/master/Source/InputHelper.cs).
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## Game
|
|
## Game
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -19,8 +17,6 @@ public static Game Game {
|
|
|
|
|
|
Your game class is available here. This gets initialized by the `Setup` function.
|
|
Your game class is available here. This gets initialized by the `Setup` function.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## IsActive
|
|
## IsActive
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -29,8 +25,6 @@ public static bool IsActive => Game.IsActive;
|
|
|
|
|
|
This is useful to disable inputs when the game is not active.
|
|
This is useful to disable inputs when the game is not active.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## Window
|
|
## Window
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -39,8 +33,6 @@ public static GameWindow Window => Game.Window;
|
|
|
|
|
|
This comes from `Game.Window`.
|
|
This comes from `Game.Window`.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## WindowWidth
|
|
## WindowWidth
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -49,8 +41,6 @@ public static int WindowWidth => Window.ClientBounds.Width;
|
|
|
|
|
|
This comes from `Window.ClientBounds.Width`. Used so that `Pressed` mouse inputs are limited to the inside of the window.
|
|
This comes from `Window.ClientBounds.Width`. Used so that `Pressed` mouse inputs are limited to the inside of the window.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## WindowHeight
|
|
## WindowHeight
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -59,8 +49,6 @@ public static int WindowHeight => Window.ClientBounds.Height;
|
|
|
|
|
|
This comes from `Window.ClientBounds.Height`. Used so that `Pressed` mouse inputs are limited to the inside of the window.
|
|
This comes from `Window.ClientBounds.Height`. Used so that `Pressed` mouse inputs are limited to the inside of the window.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## OldMouse
|
|
## OldMouse
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -69,8 +57,6 @@ public static MouseState OldMouse => _oldMouse;
|
|
|
|
|
|
This is set during `UpdateSetup()`. Used by MouseCondition in `Pressed`, `HeldOnly`, `Released`.
|
|
This is set during `UpdateSetup()`. Used by MouseCondition in `Pressed`, `HeldOnly`, `Released`.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## NewMouse
|
|
## NewMouse
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -79,8 +65,6 @@ public static MouseState NewMouse => _newMouse;
|
|
|
|
|
|
This is set during `UpdateSetup()`. Used by the MouseCondition `Pressed`, `Held`, `HeldOnly`, `Released`.
|
|
This is set during `UpdateSetup()`. Used by the MouseCondition `Pressed`, `Held`, `HeldOnly`, `Released`.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## OldKeyboard
|
|
## OldKeyboard
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -89,8 +73,6 @@ public static KeyboardState OldKeyboard => _oldKeyboard;
|
|
|
|
|
|
This is set during `UpdateSetup()`. Used by KeyboardCondition in `Pressed`, `HeldOnly`, `Released`.
|
|
This is set during `UpdateSetup()`. Used by KeyboardCondition in `Pressed`, `HeldOnly`, `Released`.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## NewKeyboard
|
|
## NewKeyboard
|
|
```csharp
|
|
```csharp
|
|
public static KeyboardState NewKeyboard => _newKeyboard;
|
|
public static KeyboardState NewKeyboard => _newKeyboard;
|
|
@@ -98,8 +80,6 @@ public static KeyboardState NewKeyboard => _newKeyboard;
|
|
|
|
|
|
This is set during `UpdateSetup()`. Used by the KeyboardCondition `Pressed`, `Held`, `HeldOnly`, `Released`.
|
|
This is set during `UpdateSetup()`. Used by the KeyboardCondition `Pressed`, `Held`, `HeldOnly`, `Released`.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## OldGamePad
|
|
## OldGamePad
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -110,8 +90,6 @@ This is set during `UpdateSetup()`. Used by GamePadCondition and AnyGamePadCondi
|
|
|
|
|
|
Contains all the previous gamepad states.
|
|
Contains all the previous gamepad states.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## NewGamePad
|
|
## NewGamePad
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -122,8 +100,6 @@ This is set during `UpdateSetup()`. Used by GamePadCondition and AnyGamePadCondi
|
|
|
|
|
|
Contains all the current gamepad states.
|
|
Contains all the current gamepad states.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## GamePadCapabilities
|
|
## GamePadCapabilities
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -132,8 +108,6 @@ public static GamePadCapabilities[] GamePadCapabilities => _gamePadCapabilities;
|
|
|
|
|
|
An array with all the info about each connected gamepad.
|
|
An array with all the info about each connected gamepad.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## GamePadDeadZone
|
|
## GamePadDeadZone
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -142,8 +116,6 @@ public static GamePadDeadZone[] GamePadDeadZone => _gamePadDeadZone;
|
|
|
|
|
|
Initialized to `GamePadDeadZone.None` for each gamepad. You can use this to set the dead zone for any gamepads.
|
|
Initialized to `GamePadDeadZone.None` for each gamepad. You can use this to set the dead zone for any gamepads.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## NewTouchCollection
|
|
## NewTouchCollection
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -152,8 +124,6 @@ public static TouchCollection NewTouchCollection => _newTouchCollection;
|
|
|
|
|
|
A touch collection that holds the previous and current touch locations.
|
|
A touch collection that holds the previous and current touch locations.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## TouchPanelCapabilities
|
|
## TouchPanelCapabilities
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -162,8 +132,6 @@ public static TouchPanelCapabilities TouchPanelCapabilities => _touchPanelCapabi
|
|
|
|
|
|
Gives info about a touch panel.
|
|
Gives info about a touch panel.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## TextEvents
|
|
## TextEvents
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -172,8 +140,6 @@ public static List<TextInputEventArgs> TextEvents => _textEvents;
|
|
|
|
|
|
Used to handle text input from any keyboard layouts. This is useful when coding textboxes. This plugs into the MonoGame `Window.TextInput`. It gets cleared every frame during `UpdateCleanup()`. The way to use this is to iterate over the list every frame. Each element will contain a char to write.
|
|
Used to handle text input from any keyboard layouts. This is useful when coding textboxes. This plugs into the MonoGame `Window.TextInput`. It gets cleared every frame during `UpdateCleanup()`. The way to use this is to iterate over the list every frame. Each element will contain a char to write.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## MouseButtons
|
|
## MouseButtons
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -182,8 +148,6 @@ public static Dictionary<MouseButton, Func<MouseState, ButtonState>> MouseButton
|
|
|
|
|
|
Maps a MouseButton to a function that can extract a specific ButtonState from a MouseState.
|
|
Maps a MouseButton to a function that can extract a specific ButtonState from a MouseState.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## GamePadButtons
|
|
## GamePadButtons
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -192,8 +156,6 @@ public static Dictionary<GamePadButton, Func<GamePadState[], int, ButtonState>>
|
|
|
|
|
|
Maps a GamePadButton to a function that can extract a specific ButtonState from a GamePadState.
|
|
Maps a GamePadButton to a function that can extract a specific ButtonState from a GamePadState.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## CurrentFrame
|
|
## CurrentFrame
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -202,8 +164,6 @@ public static uint CurrentFrame => _currentFrame;
|
|
|
|
|
|
Used by conditions to know if they've been consumed this frame.
|
|
Used by conditions to know if they've been consumed this frame.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## Setup
|
|
## Setup
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -212,8 +172,6 @@ public static void Setup(Game game);
|
|
|
|
|
|
Call this in the game's LoadContent. This initializes everything this library needs to function correctly.
|
|
Call this in the game's LoadContent. This initializes everything this library needs to function correctly.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## UpdateSetup
|
|
## UpdateSetup
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
@@ -222,8 +180,6 @@ public static void UpdateSetup();
|
|
|
|
|
|
Call this at the beginning of your update loop. This sets up everything needed to use inputs for this frame.
|
|
Call this at the beginning of your update loop. This sets up everything needed to use inputs for this frame.
|
|
|
|
|
|
----
|
|
|
|
-
|
|
|
|
## UpdateCleanup
|
|
## UpdateCleanup
|
|
|
|
|
|
```csharp
|
|
```csharp
|