Color legend plain property method
A button: a key, a mouse or pad button, or a MIDI note, with its state this frame.
A class, in the namespace BorrowedTorch.InputBinding.Types.Inputs. It derives from BaseInput. Its identity is its Source, ButtonId and Modifier. The factories of InputFactory make one in fewer characters. The inputs page shows it in context, with code.
Names are colored by what they are: a property or a method; values and fields keep the plain color.
Properties
ButtonId →
int · Read-only. Which button of its source, in a numbering the game chooses, such as MonoGame’s Keys values for keys. Part of the identity.
Modifier →
ButtonModifier · Read-only. For a key, Shift, Ctrl or Alt held with it, or None; always None off the keyboard. Part of the identity: Ctrl+S isn’t S. See the modifier keys page.
State →
ButtonState · Where the button is this frame, None at first. Live data: what a button action’s callback gets. The game sets it before each update.
Methods
ButtonInput() →
ButtonInput(InputSource source, int buttonId, ButtonModifier modifier = ButtonModifier.None) · A button input, None. A modifier given off the keyboard is dropped.
| Parameter | Type | Description |
|---|---|---|
source |
InputSource |
Which kind of device. |
buttonId |
int |
Which button of the source. |
modifier |
ButtonModifier |
For a key, the modifier held with it. Default: None. |