Skip to main content

ButtonDevice Class

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

The ButtonDevice class represents the button device to the members of a context.

public sealed class ButtonDevice : InputDevice

Properties

Target

public override UIElement Target { get; }

Returns the element that input from this device is sent to.

DeviceType

public override InputManager.InputDeviceType DeviceType { get; }

gets the Device Type / Read "Identity Object" Class Code 0x01 - Attribute ID 2 (inherited)

Methods

Focus(UIElement obj)

public UIElement Focus(UIElement obj)

Focuses the button input on a particular element.

ParameterTypeDescription
objUIElement

Returns UIElement — Element focused to

IsButtonDown(HardwareButton button)

public bool IsButtonDown(HardwareButton button)

Returns whether or not the specified button is down.

ParameterTypeDescription
buttonHardwareButton

Returns bool

IsButtonUp(HardwareButton button)

public bool IsButtonUp(HardwareButton button)

Returns whether or not the specified button is up.

ParameterTypeDescription
buttonHardwareButton

Returns bool

IsButtonHeld(HardwareButton button)

public bool IsButtonHeld(HardwareButton button)

Returns whether or not the specified button is held.

ParameterTypeDescription
buttonHardwareButton

Returns bool

GetButtonState(HardwareButton button)

public ButtonState GetButtonState(HardwareButton button)

Returns the state of the specified button.

ParameterTypeDescription
buttonHardwareButton

Returns ButtonState