/tap-android-sdk:tap-android-dpadfrom tap-android-sdk
Builds a D-Pad style controller on Android using Tap gestures: swipes for directions, pinches to select, pinch-hold for rotate or drag, fist-hold to hide. Useful for menu navigation, drag-and-drop, or game controls with TapXR/TapBand hardware.
Ships in tap-android-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.
Needs the framed protocol (sdk.isV2Tap(id)): air gestures and IMU motion. This is the same interaction as the D-Pad page in the TAP_EV sandbox (https://tapwithus.github.io/TAP_EV/).
TapBand uses the same BLE API as TapXR and is coming soon: https://www.tapwithus.com/tapband-waitlist/. Current TapXR developer firmware includes swipes, pinches with hold, and fist with hold.
The template consumes raw UnifiedAirGesture codes (the detections every Tap SDK sees). On Android you can also listen to processed onXRAirGestureReceived (SWIPE_*, CLICK_*, DRAG_*, DROP, FIST_BEGIN / FIST_END) for UI that does not need the 1 s rotate-vs-drag lock.
| User does | Codes | Event |
|---|---|---|
| Swipe left / right / up / down | 101–104 | direction + left / right / up / down |
| Short pinch thumb + index / middle / ring / pinky | 105–108 (AB–AE) | pinch index 0–3 (only when nothing is held) |
| Hold a pinch | 110–113 | hold, 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 × 100 (NONE) | release |
| Hold a fist | 114 | hide; then 2 × NONE gives show |
Repeats of the same code within 40 ms are ignored. Gesture packets stream continuously.
Copy java/DpadStateMachine.java (package com.tapwithus.tapsdk.sample). It has no Android or SDK imports.
onGesture(code, nowNanos) feeds air-gesture codes.onMotion(dx, dy, roll, nowNanos) feeds IMU motion.tick(nowNanos) locks drag mode on time if motion packets stop. Call it from a frame loop if you want the 1 s timeout even when the hand is still.held, mode, hidden are the current state for drawing.nowNanos is System.nanoTime().
Required device setup after onTapConnected when sdk.isV2Tap(id):
sdk.startXRAirMouseState(id); // AIR_GESTURE + STREAM
sdk.setFeature(id, DeviceFeature.IMU_MOTION_DATA, true);
sdk.setFeature(id, DeviceFeature.MODEL_DETECTION, true);
Wiring:
DpadStateMachine dpad = new DpadStateMachine();
void onAir(String id, AirMousePacket data) {
UnifiedAirGesture gesture = UnifiedAirGesture.fromCode(data.gesture.getInt());
if (gesture == null) return;
for (DpadStateMachine.Event event : dpad.onGesture(gesture.getCode(), System.nanoTime())) {
if ("hold".equals(event.kind) || "mode".equals(event.kind) || "pinch".equals(event.kind)) {
sdk.vibrate(id, new int[]{40});
}
apply(event);
}
}
void onMotion(ImuMotionPacket packet) {
for (DpadStateMachine.Event event : dpad.onMotion(packet.dx, packet.dy, packet.roll, System.nanoTime())) {
apply(event);
}
}
If isV2Tap is false, the connected device is on classic firmware. Offer tap combos (tap-android-tapping) instead of this recipe.
| Argument | Default | Effect |
|---|---|---|
rotateLockDeg | 25 | Roll travel needed to choose rotate. Raise it if drag is chosen too rarely. |
lockWindowNs | 1 second | Time to decide between rotate and drag. |
releaseAfter | 4 | NONE packets before release. |
showAfter | 2 | NONE packets after a fist before showing again. |
debounceNs | 40 ms | Ignore repeats of the same code in this window. |
drag deltas are raw device units. Multiply by a gain and clamp to the screen.rotate degrees are relative to the start of the hold.release.See also tap-android-knob and tap-android-vision-models.
What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/tap-android-build-an-appBuild a complete Android app or interactive experience controlled by a Tap — games, presentations, media control, or creative tools. Use when the user asks to build, make, or create something with their Tap on Android. Start with tap-android-getting-started: TapSdkFactory.getDefault, registerTapListener, resume and pause. getDefault() alone delivers no taps./tap-android-getting-startedFirst skill for any Tap Android app. The order is TapSdkFactory.getDefault(context), then registerTapListener, then resume() in onResume and pause() in onPause. getDefault() alone delivers no taps. There is no connect() or start() method. Use for the Gradle dependency, Bluetooth permissions, pairing, "connect to my Tap", setup, or no tap events./tap-android-imu-motionnpx claudepluginhub tapwithus/tap-android-sdk --plugin tap-android-sdkOther plugins' skills for the same job