https://macdailynews.com/2016/05/19/apple-patent-application-reveals-apple-pencil-to-work-with-mac-via-in-air-gestures-on-trackpad-and-as-joystick-for-games/
Apple patent application reveals Apple Pencil to work with Mac via in-air gestures, on trackpad, and as joystick for games