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.
| Parameter | Type | Description |
|---|---|---|
obj | UIElement |
Returns UIElement — Element focused to
IsButtonDown(HardwareButton button)
public bool IsButtonDown(HardwareButton button)
Returns whether or not the specified button is down.
| Parameter | Type | Description |
|---|---|---|
button | HardwareButton |
Returns bool
IsButtonUp(HardwareButton button)
public bool IsButtonUp(HardwareButton button)
Returns whether or not the specified button is up.
| Parameter | Type | Description |
|---|---|---|
button | HardwareButton |
Returns bool
IsButtonHeld(HardwareButton button)
public bool IsButtonHeld(HardwareButton button)
Returns whether or not the specified button is held.
| Parameter | Type | Description |
|---|---|---|
button | HardwareButton |
Returns bool
GetButtonState(HardwareButton button)
public ButtonState GetButtonState(HardwareButton button)
Returns the state of the specified button.
| Parameter | Type | Description |
|---|---|---|
button | HardwareButton |
Returns ButtonState