Docs / MonoInput

Glossary: ButtonStates

The values of ButtonStates.

The four states every key, button and note goes through, one update at a time.

An enum, in the namespace BorrowedTorch.MonoInput.Inputs. Every ButtonInfo and every status of a key or a note reports its state with it. The button states page shows it in context, with a picture.

Values

Idle →

Not touched. Every input starts here and comes back one update after its release. An idle key or note has no status: it isn’t in ActiveKeys or ActiveNotes.

Pressed →

Just went down: the first update the input is held. Lasts one update, then becomes Down if the input is still held, or Up if it was let go.

Down →

Still held, from the second update on. The Down checks, such as IsKeyDown and Down, are true for Pressed too.

Up →

Just let go. Lasts one update, then becomes Idle, or Pressed again if the input is held again by then.