Class VirtualJoystick

Namespace
Forma
Assembly
Forma.dll

On-screen analog joystick with normalized vector output and pointer capture.

public sealed class VirtualJoystick : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
Inheritance
VirtualJoystick
Implements
Inherited Members

Constructors

VirtualJoystick()

public VirtualJoystick()

Properties

AccessibilityActions

public override AccessibilityActions AccessibilityActions { get; }

Property Value

AccessibilityActions

AccessibilityRole

public override AccessibilityRole AccessibilityRole { get; }

Property Value

AccessibilityRole

AccessibilityValue

public override string AccessibilityValue { get; }

Property Value

string

BackgroundColor

public Color? BackgroundColor { get; set; }

Property Value

Color?

BorderColor

public Color? BorderColor { get; set; }

Property Value

Color?

DeadZone

public float DeadZone { get; set; }

Property Value

float

FixedCenter

public bool FixedCenter { get; set; }

Property Value

bool

IsPressed

public bool IsPressed { get; }

Property Value

bool

KnobColor

public Color? KnobColor { get; set; }

Property Value

Color?

Value

public Vector2 Value { get; }

Property Value

Vector2

Methods

PerformAccessibilityAction(AccessibilityActions, object)

Accepts a Microsoft.Xna.Framework.Vector2 or the same "x,y" string this control reports as its accessible value, so what it reports can be fed straight back in. The result is normalized and dead-zoned by the same rule pointer input uses, rather than assigned raw — otherwise an invoked value could sit outside the unit circle, which dragging can never produce.

public override bool PerformAccessibilityAction(AccessibilityActions action, object argument = null)

Parameters

action AccessibilityActions
argument object

Returns

bool

PointerMoved(Point)

The pointer moved over this control, in global coordinates.

protected override void PointerMoved(Point position)

Parameters

position Point

PointerPressed(Point)

A pointer press landed on this control, in global coordinates.

Protected as well as internal so a control defined outside this assembly can take part in pointer input. Without that, an app hosting its own drawing surface has to read raw mouse state instead, which bypasses hit-testing, modal gating and the injection side-channel — so such a surface cannot be driven by a test at all.

protected override void PointerPressed(Point position)

Parameters

position Point

PointerReleased(Point, bool)

The pointer was released, with whether it was still inside this control.

protected override void PointerReleased(Point position, bool isInside)

Parameters

position Point
isInside bool

Events

Pressed

public event EventHandler Pressed

Event Type

EventHandler

Released

public event EventHandler Released

Event Type

EventHandler

ValueChanged

public event Action<VirtualJoystick, Vector2> ValueChanged

Event Type

Action<VirtualJoystick, Vector2>