Skip to main content

ButtonEventArgs Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Input

The ButtonEventArgs class contains information about button states.

public class ButtonEventArgs : InputEventArgs

Constructors​

ButtonEventArgs(ButtonDevice buttonDevice, PresentationSource inputSource, DateTime timestamp, HardwareButton button)​

public ButtonEventArgs(ButtonDevice buttonDevice, PresentationSource inputSource, DateTime timestamp, HardwareButton button) : base(buttonDevice, timestamp)

Constructs an instance of the ButtonEventArgs class.

ParameterTypeDescription
buttonDeviceButtonDeviceThe button device associated with this event.
inputSourcePresentationSource
timestampDateTimeThe time when the input occured. (machine time)
buttonHardwareButtonThe button referenced by the event.

Properties​

ButtonState​

public ButtonState ButtonState { get; }

The state of the button referenced by the event.

IsRepeat​

public bool IsRepeat { get; }

Whether the button pressed is a repeated button or not.

Fields​

Button​

public readonly HardwareButton Button

The Button referenced by the event.

InputSource​

public readonly PresentationSource InputSource

The source for this button