Skip to content

Instantly share code, notes, and snippets.

@chamons
Created October 17, 2017 14:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chamons/6efc2bc14e9e40b33a1d77826a0673bc to your computer and use it in GitHub Desktop.
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