Created
October 17, 2017 14:55
-
-
Save chamons/6efc2bc14e9e40b33a1d77826a0673bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class ViewController : NSViewController | |
{ | |
public ViewController(IntPtr handle) : base(handle) | |
{ | |
} | |
public override void ViewDidLoad() | |
{ | |
base.ViewDidLoad(); | |
View.AcceptsTouchEvents = true; | |
View.WantsRestingTouches = true; | |
} | |
public override void TouchesBeganWithEvent(NSEvent theEvent) | |
{ | |
base.TouchesBeganWithEvent(theEvent); | |
var touches = theEvent.TouchesMatchingPhase(NSTouchPhase.Began, View); | |
foreach (NSTouch touch in touches.ToArray<NSTouch>()) | |
{ | |
Console.WriteLine (touch.NormalizedPosition); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment