Class ButtonStateTracker<TButton>
Tracks button state changes.
Namespace: Evergine.Common.Input
Assembly: Evergine.Common.dll
Syntax
public class ButtonStateTracker<TButton>
Type Parameters
Name | Description |
---|---|
TButton | The type of buttons to be tracked. |
Constructors
ButtonStateTracker(Action<TButton>)
Initializes a new instance of the ButtonStateTracker<TButton> class.
Declaration
public ButtonStateTracker(Action<TButton> onReleasing = null)
Parameters
Type | Name | Description |
---|---|---|
Action<TButton> | onReleasing | Action to be invoked for each releasing button. |
Methods
ButtonDown(TButton)
Handles a button down event.
Declaration
public void ButtonDown(TButton button)
Parameters
Type | Name | Description |
---|---|---|
TButton | button | The button. |
ButtonUp(TButton)
Handles a button-up event.
Declaration
public void ButtonUp(TButton button)
Parameters
Type | Name | Description |
---|---|---|
TButton | button | The button. |
Commit()
Performs a commit operation and updates the button status.
Declaration
public void Commit()
IsButtonDown(TButton)
Declaration
public bool IsButtonDown(TButton button)
Parameters
Type | Name | Description |
---|---|---|
TButton | button | The button to check. |
Returns
Type | Description |
---|---|
bool |
|
ReadButtonState(TButton)
Gets the current state of a button.
Declaration
public ButtonState ReadButtonState(TButton button)
Parameters
Type | Name | Description |
---|---|---|
TButton | button | The button to be checked. |
Returns
Type | Description |
---|---|
ButtonState | The state of the specified button. |