Detect double tap on Apple pencil

Anyone know how to detect if the Apple pencil switch has been double -tapped?

I suspect that this code should do it, (but I don’t have a pencil to test)


TapRecognizer = New UITapGestureRecognizer  //is a property of the view
TapRecognizer.numberOfTapsRequired = 2

AddHandler TapRecognizer.Gesture, AddressOf HandleTap   //is a method in the view

declare sub addGestureRecognizer lib UIKitLib selector "addGestureRecognizer:" (view as ptr, recognizer as ptr)

addGestureRecognizer(Self.Handle, TapRecognizer)

Mmmh I don’t think so.
That code is for double tapping a control on screen.

This might help:

1 Like

Yeah, that definitely looks more like it.
UIPencilInteraction isn’t covered in IOSKit

I’ll have a try to set it up, although I don’t have much of a clue about how to convert these library calls.. :slight_smile:

Nope.
I can’t work out how to do it. :slight_smile: