/tap-python-sdk:tap-tappingfrom tap-python-sdk
Decodes Tap tapcodes (finger combinations 1-31), maps them to app actions or keyboard shortcuts, and handles haptic feedback. Useful for building Tap wearable input interactions.
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.
Works on every Tap. Start from the tap-getting-started skill for connection.
A tapcode is an int 1-31. Each bit is one finger:
| Bit | Value | Finger |
|---|---|---|
| 0 | 1 | thumb |
| 1 | 2 | index |
| 2 | 4 | middle |
| 3 | 8 | ring |
| 4 | 16 | pinky |
Examples: 1 thumb, 2 index, 3 thumb+index, 6 index+middle, 31 all five.
FINGERS = ["thumb", "index", "middle", "ring", "pinky"]
def first(value): # int or [int]
return value[0] if isinstance(value, (list, tuple)) else value
def fingers(tapcode):
return [name for bit, name in enumerate(FINGERS) if tapcode & (1 << bit)]
ACTIONS = {
2: "next", # index
4: "previous", # middle
6: "select", # index + middle
31: "quit", # all fingers
}
def on_tap(identifier, tapcode):
action = ACTIONS.get(first(tapcode))
if action:
handle(action)
Single-finger taps are the most reliable. Prefer them for frequent actions. Use 2-finger combos next. Use 3+ finger combos only for rare actions.
After await sdk.start():
hasattr(sdk, "set_input_mode"): await sdk.set_input_mode(InputModeController()).
InputModeText() (default): the Tap types letters on the OS keyboard. The SDK gets no taps.InputModeController(): the SDK gets tap, mouse, and air-gesture events. No typing.InputModeControllerText(): both at the same time.set_feature(DeviceFeatures.MODEL_DETECTION, True), set_vision_sensor_model(ModelTypes.TAPPING), set_vision_sensor_op_mode(VisionSensorOpModes.TRIGGER).The SDK reports every tap. Detect double taps yourself with a time window:
import time
last = {"code": None, "t": 0.0}
def on_tap(identifier, tapcode):
code, now = first(tapcode), time.monotonic()
if code == last["code"] and now - last["t"] < 0.35:
handle_double(code)
last["code"] = None
return
last.update(code=code, t=now)
handle_single(code)
If single and double must not both fire, delay the single action until the window ends (schedule it with loop.call_later(0.35, ...) and cancel it on the second tap).
The SDK does not send OS key presses. Add a library in the user's app, for example pip install pynput:
from pynput.keyboard import Controller, Key
kb = Controller()
SHORTCUTS = {2: Key.right, 4: Key.left, 6: Key.space}
def on_tap(identifier, tapcode):
key = SHORTCUTS.get(first(tapcode))
if key:
kb.press(key); kb.release(key)
macOS: the terminal / IDE needs Accessibility permission to send keys.
await sdk.send_vibration_sequence([80]) # short buzz
await sdk.send_vibration_sequence([100, 100, 100]) # double buzz
Values are on/off durations in ms (10-2550, max 18 values). From a sync callback, schedule it: asyncio.get_running_loop().create_task(sdk.send_vibration_sequence([80])).
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