Interface IMapInputSource
- Namespace
- LansMap.Interaction
Where a map reads its mouse, keyboard and touch. Implement this to drive a map from your own input stack, or from a test.
public interface IMapInputSource
Remarks
Polled once or more per frame from the map's built-in tools. An implementation must answer without allocating.
Properties
PointerPosition
Pointer position in screen pixels, origin top left, Y increasing downward.
ScreenPoint PointerPosition { get; }
Property Value
ScrollDelta
Scroll wheel movement this frame, in notches.
float ScrollDelta { get; }
Property Value
TouchCount
Touches down this frame.
int TouchCount { get; }
Property Value
TouchSupported
Whether this device can report touches at all.
bool TouchSupported { get; }
Property Value
Methods
GetKey(KeyCode)
Whether a key is held.
bool GetKey(KeyCode key)
Parameters
keyKeyCodeKey to test.
Returns
- bool
True while the key is down.
GetKeyDown(KeyCode)
Whether a key went down this frame.
bool GetKeyDown(KeyCode key)
Parameters
keyKeyCodeKey to test.
Returns
- bool
True on the press frame only.
GetMouseButton(int)
Whether a mouse button is held.
bool GetMouseButton(int button)
Parameters
buttonint0 left, 1 right, 2 middle.
Returns
- bool
True while the button is down.
GetMouseButtonDown(int)
Whether a mouse button went down this frame.
bool GetMouseButtonDown(int button)
Parameters
buttonint0 left, 1 right, 2 middle.
Returns
- bool
True on the press frame only.
GetMouseButtonUp(int)
Whether a mouse button came up this frame.
bool GetMouseButtonUp(int button)
Parameters
buttonint0 left, 1 right, 2 middle.
Returns
- bool
True on the release frame only.
GetTouch(int)
One touch, by index.
MapTouch GetTouch(int index)
Parameters
indexint0 to TouchCount - 1.
Returns
- MapTouch
Position (screen px, top-left origin), phase, and the stable per-finger id. Track a finger across frames by that id, not by this index.