private void EndTouch(TouchState touch) { var index = IndexOfTouch(touch); if (index < 0) { return; } var duration = _activeTouches[index].Duration; _activeTouches.RemoveAt(index); if (_activeTouches.Count == 0) { if (_potentialClick) { var contact = _environment.Raycast(touch.ScreenPosition); if (duration > AltClickDuration) { ClickCanceled?.Invoke(this, new SimpleInteractionEventArgs(contact)); AltClickComplete?.Invoke(this, new SimpleInteractionEventArgs(contact)); } else { ClickComplete?.Invoke(this, new SimpleInteractionEventArgs(contact)); } _potentialClick = true; } } else if (_activeTouches.Count >= 2) { UpdateMultitouch(); } }
private void HandleJoystickButtonUp(JoystickButtonUpEventArgs args) { switch (args.Button) { case 0: ClickComplete?.Invoke(this, GetSimleEventArg()); break; case 1: AltClickComplete?.Invoke(this, GetSimleEventArg()); break; } }