Table of Contents

Namespace MLEM.Input

Classes

GamepadExtensions

A set of extension methods for dealing with Microsoft.Xna.Framework.Input.GamePad, Microsoft.Xna.Framework.Input.GamePadState and Microsoft.Xna.Framework.Input.Buttons.

InputHandler

An input handler is a more advanced wrapper around MonoGame's default input system. It includes keyboard, mouse, gamepad and touch handling through the GenericInput wrapper, as well as a new "pressed" state for inputs, the ability for keyboard and gamepad repeat events, and the ability to track down, up and press times for inputs.

Keybind

A keybind represents a generic way to trigger input. A keybind is made up of multiple key combinations, one of which has to be pressed for the keybind to be triggered. Note that this type is serializable using DataContractAttribute. Note that this class implements IComparable and IComparable<T>, which allows two combinations to be ordered based on how many Modifiers their combinations have.

Keybind.Combination

A key combination is a combination of a set of modifier keys and a key. All of the keys are GenericInput instances, so they can be keyboard-, mouse- or gamepad-based. Note that this class implements IComparable and IComparable<T>, which allows two combinations to be ordered based on how many Modifiers they have.

KeysExtensions

A set of extension methods for dealing with Microsoft.Xna.Framework.Input.Keys and Microsoft.Xna.Framework.Input.Keyboard

MouseExtensions

A set of extension methods for dealing with MouseButton and Microsoft.Xna.Framework.Input.Mouse

TextInput

A class that contains all of the necessary tools to create a text input field or box. This text input features single- and Multiline input, InputRule sets, free caret movement, copying and pasting, and more. To use this class, OnTextInput(Keys, char), Update(GameTime, InputHandler) and Draw(SpriteBatch, Vector2, float, float, Color) have to be called regularly. While this class is used by MLEM.Ui's TextField, it is designed to be used for custom or external UI systems.

Structs

GenericInput

A generic input represents any kind of input key. This includes Microsoft.Xna.Framework.Input.Keys for keyboard keys, MouseButton for mouse buttons and Microsoft.Xna.Framework.Input.Buttons for gamepad buttons. For creating and extracting inputs from a generic input, the implicit operators and Type can additionally be used. Note that this type is serializable using DataContractAttribute.

Enums

GenericInput.InputType

A type of input button.

ModifierKey

An enum representing modifier keys. A modifier key is a key that is usually pressed as part of key combination to change the function of a regular key.

MouseButton

This enum is a list of possible mouse buttons. It serves as a wrapper around Microsoft.Xna.Framework.Input.MouseState's button properties.

Delegates

TextInput.Rule

A delegate method used for InputRule. It should return whether the given text can be added to the text input.

TextInput.TextChanged

A delegate method used for OnTextChange