/tap-python-sdk:tap-vision-modelsfrom tap-python-sdk
Switches TapXR/TapBand vision models between TAPPING and AIR_GESTURE modes, sets op mode (TRIGGER/STREAM), and decodes UnifiedAirGestures (swipes, pinches, holds, fist).
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.
None: SKILL.md is the whole skill.
Model switching is TapSDK2 (set_feature / vision helpers). That is the TapXR developer firmware and TapBand (same BLE API; TapBand is coming soon). Python, Web, iOS, and Android all receive the raw detections. In Python that is register_air_gesture_events. Do not treat swipes or pinches as iOS/Android-only.
The device runs one vision model at a time:
ModelTypes | Output | Callback |
|---|---|---|
TAPPING | finger taps | register_tap_events: cb(id, [tapcode]) |
AIR_GESTURE | swipes, pinches, holds, fist | register_air_gesture_events: cb(id, [code]) |
VisionSensorOpModes | Meaning | Use with |
|---|---|---|
TRIGGER | Run the model when a tap-like trigger occurs | TAPPING |
STREAM | Run the model all the time | AIR_GESTURE |
STREAM_ON_TRIGGER | Start streaming after a trigger | experiments |
from tapsdk import DeviceFeatures, ModelTypes, UnifiedAirGestures, VisionSensorOpModes, connect
async def use_air_gestures(sdk):
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)
async def use_tapping(sdk):
await sdk.set_feature(DeviceFeatures.MODEL_DETECTION, True)
await sdk.set_vision_sensor_model(ModelTypes.TAPPING)
await sdk.set_vision_sensor_op_mode(VisionSensorOpModes.TRIGGER)
Call these after await sdk.start(). You can switch at runtime, as often as needed. Read the current state with await sdk.get_vision_sensor_model() and await sdk.get_vision_sensor_op_mode() (each returns the enum; they time out after 2 s if the device does not answer).
To start from a clean state, turn all features off first:
for feature in DeviceFeatures:
await sdk.set_feature(feature, False)
The TapXR developer firmware supports the full set: taps, thumb swipes up/down/left/right, thumb-to-finger pinches with hold, fist with hold. TapBand uses the same codes.
Letters: A = thumb, B = index, C = middle, D = ring, E = pinky. "AB" = thumb touches index (pinch).
| Code | Name | Meaning |
|---|---|---|
| 100 | COMBINED_GESTURE_NONE | No gesture / hand relaxed. Use it as "release" after a hold. |
| 101 | COMBINED_GESTURE_LEFT | Swipe left |
| 102 | COMBINED_GESTURE_RIGHT | Swipe right |
| 103 | COMBINED_GESTURE_UP | Swipe up |
| 104 | COMBINED_GESTURE_DOWN | Swipe down |
| 105-108 | COMBINED_GESTURE_AB / AC / AD / AE | Short pinch: thumb + index / middle / ring / pinky |
| 109 | COMBINED_GESTURE_FIST | Fist |
| 110-113 | COMBINED_GESTURE_AB_HOLD ... AE_HOLD | Pinch held |
| 114 | COMBINED_GESTURE_FIST_HOLD | Fist held |
def on_air_gesture(identifier, data):
gesture = UnifiedAirGestures(int(data[0]))
if gesture is UnifiedAirGestures.COMBINED_GESTURE_LEFT:
go_back()
The device sends gesture packets continuously in STREAM mode, so the same code repeats. To act once per gesture, act when the code changes, or ignore repeats within about 40 ms. Holds repeat until the hand relaxes and NONE (100) arrives. Wait for a few NONE packets in a row before you treat a hold as released (see tap-dpad).
Fist-hold switches to tapping; all-five-finger tap (31) switches back:
loop = asyncio.get_running_loop()
def on_air_gesture(identifier, data):
if data[0] == UnifiedAirGestures.COMBINED_GESTURE_FIST_HOLD.value:
loop.create_task(use_tapping(sdk))
def on_tap(identifier, data):
if data[0] == 31:
loop.create_task(use_air_gestures(sdk))
DeviceFeatures.STANDBY_GESTURE_DETECTION lets the user put the device in standby with a gesture. register_standby_state_events(cb(id, is_standby)) reports changes. await sdk.set_standby_state(False) wakes it; await sdk.get_standby_state() reads it.
TapSDK has no model switching. In InputModeController(), register_air_gesture_events gives cb(id, gesture: int) that matches AirGestures (for example UP_ONE_FINGER, LEFT_TWO_FINGERS, PINCH, THUMB_FINGER, STATE_FIST). register_air_gesture_state_events gives cb(id, MouseModes) when the air-mouse state changes. Normalize with first() if you share a callback with TapSDK2.
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-dpadBuild a D-Pad style controller with a Tap - swipes for directions, short pinches to select, pinch-hold that locks into rotate (twist) or drag (move) mode, fist-hold to hide. Use for D-Pad, menu navigation, select and move, drag and drop, rotate objects, or game controls with gestures./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.Other plugins' skills for the same job