Class ButtonStateTracker<TButton>
Tracks button state changes.
Inherited Members
Namespace: Evergine.Common.Input
Assembly: Evergine.Common.dll
Syntax
public class ButtonStateTracker<TButton>
Type Parameters
Name | Description |
---|---|
TButton | The type of the 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 every 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()
Do a commit operation and update the button status.
Declaration
public void Commit()
IsButtonDown(TButton)
Declaration
public bool IsButtonDown(TButton button)
Parameters
Type | Name | Description |
---|---|---|
TButton | button | The button to be checked. |
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. |