ITouchManager Interface |
Core manager of all pointer input in TouchScript. It is responsible for assigning unique pointer ids and keeping the list of active pointers. Controls pointer frames and dispatches pointer events.
Namespace: TouchScript
public interface ITouchManager
The ITouchManager type exposes the following members.
Name | Description | |
---|---|---|
DisplayDevice |
Gets or sets current display device.
| |
DotsPerCentimeter |
Gets number of pixels in a cm with current DPI.
| |
DPI |
Gets current DPI.
| |
Inputs |
Gets the list of IInputSource | |
IsInsidePointerFrame |
Indicates that execution is currently inside a TouchScript Pointer Frame, i.e. before FrameFinished and after FrameStarted events.
| |
Pointers |
Gets the list of pointers.
| |
PointersCount |
Gets number of pointers in the system.
| |
PressedPointers |
Gets the list of pressed pointers.
| |
PressedPointersCount |
Gets the number of pressed pointer in the system.
| |
ShouldCreateCameraLayer |
Indicates if TouchScript should create a StandardLayer for you if no layers present in a scene.
| |
ShouldCreateStandardInput |
Gets or sets a value indicating whether a StandardInput should be created in scene if no inputs present.
|
Name | Description | |
---|---|---|
AddInput |
Adds an input source.
| |
CancelPointer(Int32) |
Cancels a pointer.
| |
CancelPointer(Int32, Boolean) |
Cancels a pointer and returns it to the system of need.
| |
RemoveInput |
Removes the input.
| |
UpdateResolution |
Tells TouchScript to update internal state after a resolution change.
|
Name | Description | |
---|---|---|
FrameFinished |
Occurs when a frame is finished. After all other events.
| |
FrameStarted |
Occurs when a new frame is started before all other events.
| |
PointersAdded |
Occurs when new hovering pointers are added.
| |
PointersCancelled |
Occurs when pointers are cancelled.
| |
PointersPressed |
Occurs when pointers touch the surface.
| |
PointersReleased |
Occurs when pointers are released.
| |
PointersRemoved |
Occurs when pointers are removed from the system.
| |
PointersUpdated |
Occurs when pointers are updated.
|
Every frame pointer events are dispatched in this order:
FrameStarted and FrameFinished events mark the start and the end of current pointer frame and allow to implement specific logic at these moments.
Current instance of an active object implementing ITouchManager can be obtained via Instance.
TouchManager.Instance.PointersPressed += (sender, args) => { foreach (var pointer in args.Pointers) Debug.Log("Pressed: " + pointer.Id); }; TouchManager.Instance.PointersReleased += (sender, args) => { foreach (var pointer in args.Pointers) Debug.Log("Released: " + pointer.Id); };