public override void TouchesBegan (NSSet touchesSet, UIEvent evt) { var touches = touchesSet.ToArray<UITouch> (); touchPhaseLabel.Text = "Phase:Touches began"; touchInfoLabel.Text = ""; var numTaps = touches.Sum (t => t.TapCount); if (numTaps >= 2){ touchInfoLabel.Text = string.Format ("{0} taps", numTaps); if (numTaps == 2 && piecesOnTop) { // recieved double tap -> align the three pieces diagonal. if (firstImage.Center.X == secondImage.Center.X) secondImage.Center = new PointF (firstImage.Center.X - 50, firstImage.Center.Y - 50); if (firstImage.Center.X == thirdImage.Center.X) thirdImage.Center = new PointF (firstImage.Center.X + 50, firstImage.Center.Y + 50); if (secondImage.Center.X == thirdImage.Center.X) thirdImage.Center = new PointF (secondImage.Center.X + 50, secondImage.Center.Y + 50); touchInstructionLabel.Text = ""; } } else { touchTrackingLabel.Text = ""; } foreach (var touch in touches) { // Send to the dispatch method, which will make sure the appropriate subview is acted upon DispatchTouchAtPoint (touch.LocationInView (window)); } }
// void TouchesBeganWithEvent (NSSet touches, UIEvent theEvent) // { // _ctr = 0; // UITouch touch = touches.AnyObject (); // Pts [0] = touch.LocationInView (this); // } public override void TouchesBegan (NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); _ctr = 0; UITouch touch = touches.AnyObject as UITouch; Pts [0] = touch.LocationInView (this); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { var touch = (UITouch) touches.AnyObject; if (touch.Phase == UITouchPhase.Began){ Console.WriteLine ("Overlay view touched"); } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); UITouch touch = touches.AnyObject as UITouch; var el = this.Element as BoxViewEx; el.OnManipulationStarted(el, new ManipulationStartedRoutedEventArgs()); }
/// <summary> /// Called when the fingers move /// </summary> public override void TouchesMoved (NSSet touches, UIEvent evt) { base.TouchesMoved (touches, evt); // if we haven't already failed if (base.State != UIGestureRecognizerState.Failed) { // get the current and previous touch point CGPoint newPoint = (touches.AnyObject as UITouch).LocationInView (View); CGPoint previousPoint = (touches.AnyObject as UITouch).PreviousLocationInView (View); // if we're not already on the upstroke if (!strokeUp) { // if we're moving down, just continue to set the midpoint at // whatever point we're at. when we start to stroke up, it'll stick // as the last point before we upticked if (newPoint.X >= previousPoint.X && newPoint.Y >= previousPoint.Y) { midpoint = newPoint; } // if we're stroking up (moving right x and up y [y axis is flipped]) else if (newPoint.X >= previousPoint.X && newPoint.Y <= previousPoint.Y) { strokeUp = true; } // otherwise, we fail the recognizer else { base.State = UIGestureRecognizerState.Failed; } } } Console.WriteLine (base.State.ToString ()); }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // if they touched a dead area, reveal the nav toolbar again. //NavToolbar.RevealForTime( 3.0f ); }
/// <summary> /// Called when the touches are cancelled due to a phone call, etc. /// </summary> public override void TouchesCancelled (NSSet touches, UIEvent evt) { base.TouchesCancelled (touches, evt); // we fail the recognizer so that there isn't unexpected behavior // if the application comes back into view base.State = UIGestureRecognizerState.Failed; }
public override void TouchesBegan (NSSet touches, UIEvent evt) { // hide keyboard name.ResignFirstResponder(); email.ResignFirstResponder(); comments.ResignFirstResponder(); }
public override void TouchesBegan(NSSet touchesSet, UIEvent evt) { var touches = touchesSet.ToArray<UITouch> (); touchPhaseLabel.Text = "Phase:Touches began"; touchInfoLabel.Text = ""; var numTaps = touches.Sum (t => t.TapCount); if (numTaps >= 2){ touchInfoLabel.Text = string.Format ("{0} taps", numTaps); if (numTaps == 2 && piecesOnTop) { // recieved double tap -> align the three pieces diagonal. firstImage.Center = new PointF (padding + firstImage.Frame.Width / 2f, touchInfoLabel.Frame.Bottom + padding + firstImage.Frame.Height / 2f); secondImage.Center = new PointF (View.Bounds.Width / 2f, View.Bounds.Height / 2f); thirdImage.Center = new PointF (View.Bounds.Width - thirdImage.Frame.Width / 2f - padding, touchInstructionLabel.Frame.Top - thirdImage.Frame.Height); touchInstructionLabel.Text = ""; } } else { touchTrackingLabel.Text = ""; } foreach (var touch in touches) { // Send to the dispatch method, which will make sure the appropriate subview is acted upon DispatchTouchAtPoint (touch.LocationInView (View)); } }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { base.TouchesCancelled(touches, evt); // reset our tracking flags touchStartedInside = false; }
public override void TouchesBegan(NSSet touches, UIEvent evt) { if (!Dragging) NextResponder.TouchesBegan(touches, evt); else base.TouchesBegan(touches, evt); }
public override void TouchesEnded( NSSet touches, UIEvent evt ) { if( Interceptor != null ) { Interceptor.TouchesEnded( touches, evt ); } }
public override void TouchesEnded(NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); //TODO : check this to make sure Control is ok or do we need another on like InputControl var source = Controller.TableView.Source as BaseDialogViewSource; if (source != null) { foreach (var section in source.Sections.Values) { foreach (var viewList in section.Views.Values) { foreach(var view in viewList) { var focusable = view as IFocusable; if (focusable != null && focusable.Control != null && focusable.Control.IsFirstResponder) { focusable.Control.ResignFirstResponder(); break; } } } } } ResetTextShadow(true, touches); }
public override void TouchesBegan (NSSet touches, UIEvent evt) { this.ExclusiveTouch = true; IndexCount++; var path = new UIBezierPath { LineWidth = PenWidth } ; var touch = (UITouch)touches.AnyObject; PreviousPoint = (PointF)touch.PreviousLocationInView (this); var newPoint = touch.LocationInView (this); path.MoveTo (newPoint); InvokeOnMainThread (SetNeedsDisplay); CurrentPath = path; var line = new VESLine { Path = CurrentPath, Color = UIColor.Black, Index = IndexCount } ; Lines.Add (line); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { foreach (UITouch touch in touches.ToArray<UITouch>()) { Console.WriteLine(touch); } }
//TODO: Step 2 - Subscribe to touches began events public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); // we can get the number of fingers from the touch count, but Multitouch must be enabled lblNumberOfFingers.Text = string.Format("Number of Fingers: {0}", touches.Count); // get the touch var touch = touches.AnyObject as UITouch; if (touch == null) return; Console.WriteLine("screen touched"); //TODO: Step 3 - Check if touch was on a particular view if (imgTouchMe.Frame.Contains(touch.LocationInView(View))) lblTouchStatus.Text = "Touch Status: Touches Began"; //TODO: Step 4 - Detect multiple taps if (touch.TapCount == 2 && imgTapMe.Frame.Contains(touch.LocationInView(View))) { imgTapMe.Image = UIImage.FromBundle( imageHighlighted ? "Images/DoubleTapMe.png" : "Images/DoubleTapMe_Highlighted.png"); imageHighlighted = !imageHighlighted; } //TODO: Step 5 - Start recording a drag event if (imgDragMe.Frame.Contains(touch.LocationInView(View))) touchStartedInside = true; }
public void TouchesBegan(NSSet touchSet, UIEvent evnt) { if (DispatchEvents) { List<TouchHandler> handlers = new List<TouchHandler>(_touchHandlers); // Make full-aot aware of the needed ICollection<UITouch> types ICollection<UITouch> touches_col = (ICollection<UITouch>)touchSet.ToArray<UITouch>(); #pragma warning disable 0219 // this is a tiny hack, make sure the AOT compiler knows about // UICollection.Count, as it will need it when we instantiate the list below int touches_count = touches_col.Count; #pragma warning restore 0219 List<UITouch> touches = new List<UITouch>(touches_col); foreach (TouchHandler handler in handlers) { if (handler.TouchesBegan(touches, evnt)) { break; } if (touches.IsEmpty()) { break; } } } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesMoved (touches, evt); actions [(int)PlayerActions.Action] = false; actions [(int)PlayerActions.Left] = false; actions [(int)PlayerActions.Right] = false; actions [(int)PlayerActions.Forward] = false; actions [(int)PlayerActions.Back] = false; UITouch touch = (UITouch)touches.AnyObject; var location = touch.LocationInView (View); var deltaX = location.X - controlledShip.Position.X; var deltaY = (480 - location.Y) - controlledShip.Position.Y; if (Math.Abs (deltaX) < 30 && Math.Abs (deltaY) < 30) actions [(int)PlayerActions.Action] = true; else if (Math.Abs (deltaX) > Math.Abs (deltaY)) { if (deltaX < 0) actions [(int)PlayerActions.Left] = true; else actions [(int)PlayerActions.Right] = true; } else { if (deltaY < 0) actions [(int)PlayerActions.Forward] = true; else actions [(int)PlayerActions.Back] = true; } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); UITouch touch = touches.AnyObject as UITouch; _previousLocation = touch.LocationInView (touch.View); }
public override void TouchesEnded(NSSet touches, UIEvent evt) { try { bool allTouchesEnded = (touches.Count == evt.TouchesForView (this).Count); // first check for plain single/double tap, which is only possible if we haven't seen multiple touches if (!multipleTouches) { var touch = (UITouch)touches.AnyObject; // tapLocation = touch.LocationInView(this); if (touch.TapCount == 1) { if (Tapped != null) Tapped (this); } else if (touch.TapCount == 2) { if (DoubleTapped != null) DoubleTapped (this); } } } catch { } base.TouchesEnded (touches, evt); }
public override void TouchesEnded (NSSet touches, UIEvent evt) { CanvasView.DrawTouches (touches, evt); CanvasView.EndTouches (touches, false); ReticleView.Hidden = true; }
public override void TouchesBegan (NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); // we can get the number of fingers from the touch count, but Multitouch must be enabled lblNumberOfFingers.Text = "Number of fingers: " + touches.Count.ToString(); // get the touch UITouch touch = touches.AnyObject as UITouch; if (touch != null) { Console.WriteLine("screen touched"); //==== IMAGE TOUCH if (imgTouchMe.Frame.Contains (touch.LocationInView (View))) lblTouchStatus.Text = "TouchesBegan"; //==== IMAGE DOUBLE TAP if(touch.TapCount == 2 && imgTapMe.Frame.Contains (touch.LocationInView (View))) { if (imageHighlighted) imgTapMe.Image = UIImage.FromBundle ("Images/DoubleTapMe.png"); else imgTapMe.Image = UIImage.FromBundle ("Images/DoubleTapMe_Highlighted.png"); imageHighlighted = !imageHighlighted; } //==== IMAGE DRAG // check to see if the touch started in the dragme image if (imgDragMe.Frame.Contains (touch.LocationInView (View))) touchStartedInside = true; } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); //get the touch event UITouch touch = touches.AnyObject as UITouch; if (touch != null) { if (imgCub.Frame.Contains (touch.LocationInView (View))) { touchStartedInside = true; playSound("CubScouts"); } if (imgTiger.Frame.Contains (touch.LocationInView (View))) { touchStartedInside = true; playSound("Tiger"); } if (imgWolf.Frame.Contains (touch.LocationInView (View))) { touchStartedInside = true; playSound("Wolf"); } if (imgBear.Frame.Contains (touch.LocationInView (View))) { touchStartedInside = true; playSound("Bear"); } if (imgWeblo.Frame.Contains (touch.LocationInView (View))) { touchStartedInside = true; playSound("Weblo"); } } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); UITouch touch = touches.AnyObject as UITouch; if (touch != null) { if (c > MAX_SHAPES) { foreach (UIView v in this.Subviews) { if (v != Subviews[0]) v.RemoveFromSuperview (); } var monkeyView = Subviews[0]; UIView.BeginAnimations ("flip"); monkeyView.Transform = CGAffineTransform.MakeRotation ((float)Math.PI * n); (monkeyView as UIImageView).Image = SwapMonkey (); UIView.CommitAnimations (); Util.Instance.PlaySound (); n++; c = 0; } else { PointF pt = touch.LocationInView (this); _sv = CreateShapeView (pt); this.AddSubview (_sv); } c++; } PulseShape (); }
public override void TouchesCancelled (NSSet touches, UIEvent evt) { if (touches == null) return; CanvasView.EndTouches (touches, true); ReticleView.Hidden = true; }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); BackViewController bvc = new BackViewController(this); bvc.ModalTransitionStyle = GetRandomTransitionStyle(); PresentModalViewController(bvc, true); }
/// <summary> /// Toucheses the began. /// </summary> /// <param name="touches">Touches.</param> /// <param name="evt">Evt.</param> public override void TouchesBegan (NSSet touches, UIEvent evt) { //Inform caller of event RaiseTouched (); //Pass call to base object base.TouchesBegan (touches, evt); }
public override void TouchesBegan (NSSet touches, UIEvent evt) { base.TouchesBegan (touches, evt); // hide the keyboard this.locationTextField.ResignFirstResponder (); this.messageTextField.ResignFirstResponder (); }
public override void TouchesBegan (NSSet touches, UIEvent evt) { var touchPoint = ((UITouch)touches.AnyObject).LocationInView (this); base.TouchesBegan (touches, evt); ((MyAnnotation)this.Annotation).Click (); }
public override void TouchesMoved (NSSet touches, UIEvent evt) { base.TouchesMoved (touches, evt); // get the touch UITouch touch = touches.AnyObject as UITouch; if (touch != null) { AddSpot (touch); } }
public override void TouchesEnded(NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); OnTouchEnd?.Invoke(); }
public override void TouchesEnded(NSSet touches, UIEvent @event) { this.actionClicked.Invoke(this); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { ResetTextShadow(false, touches); base.TouchesBegan(touches, evt); }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { base.TouchesCancelled(touches, evt); _shouldNotDismiss = true; }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { isEventHandled = false; base.TouchesCancelled(touches, evt); }
public override void TouchesEnded(NSSet touches, UIEvent evt) { base.TouchesEnded(touches, evt); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); OnTouchBegin?.Invoke(); }
public void Ctor() { using (var arr = new NSSet <NSDate> ()) { Assert.AreEqual((nuint)0, arr.Count, "Count"); } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { this.TableView.EndEditing(true); }
public override void TouchesEnded(NSSet touches, UIKit.UIEvent evt) { base.TouchesEnded(touches, evt); zxingView.AutoFocus(); }
private void tagsAliasCallback(int iResCode, NSSet tags, NSString alias) { }
/// <summary> /// Calls when user clicks by thumb /// </summary> public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); _ThumbSelectedCallback(this); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { this.Expanded = !this.Expanded; }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { base.TouchesCancelled(touches, evt); OnTouchCancelled?.Invoke(); }
HashSet <UITouch> Touches(NSSet touches) { return(new HashSet <UITouch> (touches.Cast <UITouch> ())); }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { base.TouchesCancelled(touches, evt); TouchesCancelledDelegate(touches, evt); }
public override void TouchesMoved(NSSet touches, UIEvent evt) { _formsMap.MoveMap(); base.TouchesMoved(touches, evt); }
public override void ItemsSelected(NSCollectionView collectionView, NSSet indexPaths) { SelectionChanged?.Invoke(this, indexPaths); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { app.text.ResignFirstResponder(); app.text.Text = "Tapped"; }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); TouchesBeganDelegate(touches, evt); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { foreach (var touch in touches) { CGPoint location = (touch as UITouch).LocationInNode(this); if (_camNode.Frame.Contains(location)) { //PresentScene(new MainMenuScene(Size)); actionSheet = new UIActionSheet("Which Hater?"); //actionSheet.AddButton ("Delete"); actionSheet.AddButton("Cancel"); actionSheet.AddButton("Camera"); actionSheet.AddButton("Photo Album"); //actionSheet.DestructiveButtonIndex = 0; // red actionSheet.CancelButtonIndex = 0; // black actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine("Button " + b.ButtonIndex.ToString() + " clicked"); if (b.ButtonIndex == 1) { //camera //imgPckr = null; imgPckr = new UIImagePickerController(); //imgPckr.Delegate = Self; imgPckr.AllowsEditing = true; imgPckr.SourceType = UIImagePickerControllerSourceType.Camera; //imgPckr.MediaTypes = UIImagePickerController.AvailableMediaTypes (UIImagePickerControllerSourceType.Camera); imgPckr.FinishedPickingMedia += Handle_FinishedPickingMedia; imgPckr.Canceled += Handle_Canceled; Scene.View.Window.RootViewController.PresentModalViewController(imgPckr, true); } else if (b.ButtonIndex == 2) { //album //imgPckr = null; imgPckr = new UIImagePickerController(); //imgPckr.Delegate = Self; imgPckr.AllowsEditing = true; imgPckr.SourceType = UIImagePickerControllerSourceType.PhotoLibrary; //imgPckr.MediaTypes = UIImagePickerController.AvailableMediaTypes (UIImagePickerControllerSourceType.Camera); imgPckr.FinishedPickingMedia += Handle_FinishedPickingMedia; imgPckr.Canceled += Handle_Canceled; Scene.View.Window.RootViewController.PresentModalViewController(imgPckr, true); } }; actionSheet.ShowInView(View); } if (_img1.Frame.Contains(location)) { currentSelected = 1; GameObj.finalImage = _image1; movePin(_img1.Position); } if (_img2.Frame.Contains(location)) { currentSelected = 2; GameObj.finalImage = _image2; movePin(_img2.Position); } if (_img3.Frame.Contains(location)) { currentSelected = 3; GameObj.finalImage = _image3; movePin(_img3.Position); } if (_menuButton.Frame.Contains(location)) { DataStorage(); PresentScene(new MainMenuScene(Size)); } } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); _shouldNotDismiss = false; // reset }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); ResignFirstResponder(); }
public override void TouchesCancelled(NSSet touches, UIEvent evt) { base.TouchesCancelled(touches, evt); ResetTextShadow(true, touches); }
public override void TouchesBegan(NSSet touches, UIEvent evt) { State = UIGestureRecognizerState.Began; base.TouchesBegan(touches, evt); }
public override bool CanDragItems(NSCollectionView collectionView, NSSet indexPaths, NSEvent theEvent) { DragBegin?.Invoke(this, null); return(false); }
public override void TouchesMoved(NSSet touches, UIEvent evt) { State = UIGestureRecognizerState.Recognized; base.TouchesMoved(touches, evt); }
public void DidDiscardSceneSessions(UIApplication application, NSSet <UISceneSession> sceneSessions) { // Called when the user discards a scene session. // If any sessions were discarded while the application was not running, this will be called shortly after `FinishedLaunching`. // Use this method to release any resources that were specific to the discarded scenes, as they will not return. }
public override void TouchesBegan(NSSet touches, UIEvent evt) { base.TouchesBegan(touches, evt); View.EndEditing(true); }
public override void TouchesEnded(NSSet touches, UIEvent e) { Refresh(); HandleInfo(e.AllTouches); }