Created
October 17, 2017 14:55
Star
You must be signed in to star a gist
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