Class TouchDeviceImp
Touch input device implementation for the Web platforms. This implementation uses the HTML5 touch api which doesn't seem to provide a value how many simultaneous touchpoints are supported. Thus we assume 5.
Inheritance
Implements
Inherited Members
Namespace: Fusee.Engine.Imp.Graphics.Blazor
Assembly: Fusee.Engine.Imp.Graphics.Blazor.dll
Syntax
public class TouchDeviceImp : IInputDeviceImp
Constructors
TouchDeviceImp(IJSObjectReference, IJSRuntime)
Implements a touch device for windows.
Declaration
public TouchDeviceImp(IJSObjectReference canvas, IJSRuntime runtime)
Parameters
Type | Name | Description |
---|---|---|
IJSObjectReference | canvas | |
IJSRuntime | runtime | The Javascript runtime |
Properties
AxesCount
Returns the number of axes. Up to five touchpoints (with two axes (X and Y) per touchpoint plus one axis carrying the number of currently touched touchpoints plus four axes describing the minimum and maximum X and Y values.
Declaration
public int AxesCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The axes count. |
AxisImpDesc
Returns description information for all axes.
Declaration
public IEnumerable<AxisImpDescription> AxisImpDesc { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<AxisImpDescription> |
ButtonCount
Retrieves the button count. One button for each of the up to five supported touchpoints signaling that the touchpoint currently has contact.
Declaration
public int ButtonCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The button count. |
ButtonImpDesc
Retrieve a description for each button.
Declaration
public IEnumerable<ButtonImpDescription> ButtonImpDesc { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ButtonImpDescription> | The button imp description. |
Category
Returns Touch, just because it's a touch device.
Declaration
public DeviceCategory Category { get; }
Property Value
Type | Description |
---|---|
DeviceCategory |
Desc
Short description string for this device to be used in dialogs.
Declaration
public string Desc { get; }
Property Value
Type | Description |
---|---|
System.String |
Id
Returns a (hopefully) unique ID for this driver. Uniqueness is granted by using the full class name (including namespace).
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetAxis(Int32)
Retrieves values for the number of currently active touchpoints and the touches min and max values. The touchpoint X and Y axes themselves are event-based axes. Do not query them here.
Declaration
public float GetAxis(int iAxisId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iAxisId | The axis to retrieve information for. |
Returns
Type | Description |
---|---|
System.Single | The value at the given axis. |
GetButton(Int32)
Gets the button state. This device's buttons signal that a finger (nose, elbow, knee...) currently has contact with the scree surface.
Declaration
public bool GetButton(int iButtonId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iButtonId | The button identifier. |
Returns
Type | Description |
---|---|
System.Boolean | true if the button is hit, else false |
P2F(Object)
Converts the value of a touch point to float.
Declaration
public static float P2F(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | The value of the point to convert. |
Returns
Type | Description |
---|---|
System.Single |
Events
AxisValueChanged
Occurs on value changes of axes exhibited by this device. Only applies for axes where the PollAxis is set to false.
Declaration
public event EventHandler<AxisValueChangedArgs> AxisValueChanged
Event Type
Type | Description |
---|---|
System.EventHandler<AxisValueChangedArgs> |
ButtonValueChanged
A touchpoints's contact state is communicated by a button.
Declaration
public event EventHandler<ButtonValueChangedArgs> ButtonValueChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ButtonValueChangedArgs> |