Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.