So you would like to add 3D tracking, gesture, and touch sensing to your Raspberry Pi project? The Flick Zero 3D tracking & gesture pHAT can help. It detects your gestures from up to 15cm away and works with various Raspberry Pi models and other boards with 40 GPIO pins.
The kit comes with open-source code. Swipe, tap, double tap, and other common gestures are supported.