Class PointerDeviceBase
Base class for pointer devices
public abstract class PointerDeviceBase : IPointerDevice, IInputDevice
- Inheritance
-
PointerDeviceBase
- Implements
- Derived
Constructors
PointerDeviceBase()
protected PointerDeviceBase()
Fields
PointerState
protected PointerDeviceState PointerState
Field Value
Properties
DownPointers
The index of the pointers that are down
public IReadOnlySet<PointerPoint> DownPointers { get; }
Property Value
Id
The unique identifier of this device
public abstract Guid Id { get; }
Property Value
Name
The name of the device
public abstract string Name { get; }
Property Value
PressedPointers
The index of the pointers that have been pressed since the last frame
public IReadOnlySet<PointerPoint> PressedPointers { get; }
Property Value
Priority
The device priority. Larger means higher priority when selecting the first device of some type
public int Priority { get; set; }
Property Value
ReleasedPointers
The index of the pointers that have been released since the last frame
public IReadOnlySet<PointerPoint> ReleasedPointers { get; }
Property Value
Source
The input source the device belongs to.
public abstract IInputSource Source { get; }
Property Value
SurfaceAspectRatio
The aspect ratio of the touch surface area
public float SurfaceAspectRatio { get; }
Property Value
SurfaceSize
The size of the surface used by the pointer, for a mouse this is the size of the window, for a touch device, the size of the touch area, etc.
public Vector2 SurfaceSize { get; }
Property Value
Methods
Normalize(Vector2)
protected Vector2 Normalize(Vector2 position)
Parameters
position
Vector2
Returns
SetSurfaceSize(Vector2)
Calls SetSurfaceSize(Vector2) and invokes the SurfaceSizeChanged event
protected void SetSurfaceSize(Vector2 newSize)
Parameters
newSize
Vector2New size of the surface
Update(List<InputEvent>)
Updates the input device, filling the list inputEvents
with input events that were generated by this device this frame
public virtual void Update(List<InputEvent> inputEvents)
Parameters
inputEvents
List<InputEvent>A list that gets filled with input events that were generated since the last frame
Remarks
Input devices are always updated after their respective input source
Events
SurfaceSizeChanged
Raised when the surface size of this pointer changed
public event EventHandler<SurfaceSizeChangedEventArgs> SurfaceSizeChanged