/tap-python-sdk:tap-dpadfrom tap-python-sdk
Builds a D-Pad style gesture controller for TapXR/TapBand devices. Maps swipes, pinches, and holds to directional input, selection, drag-and-drop, and object rotation.
Ships in tap-python-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Needs the TapXR developer firmware or TapBand: air gestures and IMU motion. TapBand uses the same BLE API and is coming soon. This is the same interaction as the D-Pad page in the TAP_EV sandbox (https://tapwithus.github.io/TAP_EV/).
| User does | Codes | Event |
|---|---|---|
| Swipe left / right / up / down | 101-104 | ("direction", "left") ... |
| Short pinch thumb + index / middle / ring / pinky | 105-108 (AB-AE) | ("pinch", 0..3) (only when nothing is held) |
| Hold a pinch | 110-113 | ("hold", i), mode pending |
| ...and twist 25° or more within 1 s | IMU roll | ("mode", "rotate"), then ("rotate", degrees) |
| ...and do not twist | - | after 1 s ("mode", "drag"), then ("drag", dx, dy) |
| Relax the hand | 4 x 100 (NONE) | ("release", i): snap back or drop the item |
| Hold a fist | 114 | ("hide",); then 2 x NONE gives ("show",) |
Repeats of the same code within 40 ms are ignored (gesture packets stream continuously).
stateDiagram-v2
idle --> pending: pinch hold
pending --> rotate: roll travel >= 25 deg
pending --> drag: 1 s without enough roll
rotate --> idle: 4 x NONE
drag --> idle: 4 x NONE
idle --> hidden: fist hold
hidden --> idle: 2 x NONE
Copy scripts/dpad.py. It has:
DpadStateMachine: pure logic, no Bluetooth. All methods take now in seconds (time.monotonic()) and return a list of event tuples.
on_gesture(code, now): feed air-gesture codes.on_motion(dx, dy, roll, now): feed IMU motion.tick(now): optional; locks drag mode on time if motion packets stop.held, mode, hidden: current state for drawing the UI.main(): connects, checks for set_feature, enables features, prints events, and buzzes on hold / mode lock / pinch.Required device setup (after await sdk.start()):
await sdk.set_feature(DeviceFeatures.MODEL_DETECTION, True)
await sdk.set_vision_sensor_model(ModelTypes.AIR_GESTURE)
await sdk.set_vision_sensor_op_mode(VisionSensorOpModes.STREAM)
await sdk.set_feature(DeviceFeatures.IMU_MOTION_DATA, True)
| Argument | Default | Effect |
|---|---|---|
rotate_lock_deg | 25 | Roll travel needed to choose rotate. Raise it if drag is chosen too rarely. |
lock_window_s | 1.0 | Time to decide between rotate and drag. |
release_after | 4 | NONE packets before release. |
show_after | 2 | NONE packets after a fist before showing again. |
debounce_s | 0.040 | Ignore repeats of the same code in this window. |
drag deltas are raw device units. Multiply by a gain (TAP_EV uses about 0.45 px per unit) and clamp to the screen.rotate gives degrees relative to the start of the hold. TAP_EV multiplies by 1.8 for a stronger visual turn.("release", i) (TAP_EV does this).tap-build-an-app.See also tap-knob (hold + twist for values) and tap-vision-models (all gesture codes).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tapwithus/tap-python-sdk --plugin tap-python-sdk8 skills in this plugin
/tap-build-an-appBuild a complete app or interactive experience controlled by a Tap - games, browser pages, presentations, media control, keyboard shortcuts, or creative tools. Use when the user asks to "build", "make", or "create" something with their Tap, especially if they are not a developer./tap-getting-startedFirst skill for any Tap app. The connect order is await connect(), then register_* callbacks, then await sdk.start(), then enable input. connect() alone delivers no taps. Use for install, pairing, "connect to my Tap", setup, or no tap events./tap-imu-motionUse Tap hand motion - IMU motion data (dx, dy, roll, pitch, yaw) and mouse events - to move a cursor, steer, tilt, or rotate things. Use for air mouse, pointer, cursor control, tilt, orientation, euler angles, roll/pitch/yaw, or motion-driven UI.Other plugins' skills for the same job