Skip to content
Skills Library
Programming · Building & coding

tapkit-tapping

/tapkit-tapping

Decode TAP finger combinations, map them to in-app actions, detect double taps, and give haptic feedback with vibrate(durations:). Use for tapping, finger combos, chords, in-app shortcuts, multitap, or TAPInputMode.

Repository
tap-ios-sdk ↗
Licence
Apache-2.0
Last repository change
21.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Decode TAP finger combinations, map them to in-app actions, detect double taps, and give haptic feedback with vibrate(durations:). Use for tapping, finger combos, chords, in-app shortcuts, multitap, or TAPInputMode.

Original author description

Decode TAP finger combinations, map them to in-app actions, detect double taps, and give haptic feedback with vibrate(durations:). Use for tapping, finger combos, chords, in-app shortcuts, multitap, or TAPInputMode.

How it works

  1. Combination bitmask
  2. Turn on tap events
  3. Double taps
  4. Typing and in-app actions
  5. Haptic feedback
  6. Docs
Original SKILL.md headings · 103 lines, 558 words
SKILL.md preview
---
name: tapkit-tapping
description: Decode TAP finger combinations, map them to in-app actions, detect double taps, and give haptic feedback with vibrate(durations:). Use for tapping, finger combos, chords, in-app shortcuts, multitap, or TAPInputMode.
---

# Tapping

Works on Tap Strap, Tap Strap 2, TapXR, and TapBand. Start from `tapkit-getting-started` for the connect order.

## Combination bitmask

`combination` in `tapped` is an integer 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.

```swift
func tapped(identifier: String, combination: UInt8, multitap: UInt8) {
    let fingers = TAPCombination.toFingers(combination) // [Bool] thumb → pinky
    switch combination {
    case 2: goNext()        // index
    case 4: goPrevious()    // middle
    case 6: select()        // index + middle
    case 31: close()        // all five
    default: break
    }
}
```

`TAPCombination.fromFingers` builds a bitmask. `TAPCombination.combinationSpeakableString(for:)` is a debug string.

Single-finger taps are the most reliable. Prefer them for frequent actions. Use two-finger combos next. Use three or more fingers only for rare actions.

`multitap` is 1–3 and reflects keyboard multitap state when the firmware sends it. It is not a double-tap detector. Detect double taps yourself (below).

## Turn on tap events

- `TAPInputMode.controller()` — **default you want.** Delivers `tapped` and `moused`.
- `TAPInputMode.text()` — the Tap is a Bluetooth keyboard. `tapped` and `moused` do **not** fire. Use this only when the user should type into a text field.
- `TAPInputMode.controllerWithMouseHID()` — controller callbacks plus the system AssistiveTouch cursor (iOS 13+).
- `TAPInputMode.controllerWithFullHID()` — full HID controller mode.
- `TAPInputMode.tapHold()` — short taps still arrive via `tapped`. Long presses arrive via `tapHoldStarted` / `tapHoldEnded`.

```swift
TAPKit.sharedKit.setTAPInputMode(.controller(), forIdentifiers: nil)
TAPKit.sharedKit.setDefaultTAPInputMode(.controller(), immediate: true)
```

On TapXR and TapBand, also set `TAPXRState.tapping()` so the device stays in tapping rather than air-mouse. You can set the tapping vision model directly (see `tapkit-air-gestures`).

The SDK re-sends the current mode on a timer while the app is active, so the device stays in it.

## Double taps

The SDK reports every tap. Detect a double tap with a time window. If a single tap must not also fire, delay the single action until the window ends.

```swift
private var lastCode: UInt8?
private var lastTap = Date.distantPast
private var pending: DispatchWorkItem?

func tapped(identifier: String, combination: UInt8, multitap: UInt8) {
    let now = Date()
    if lastCode == combination, now.timeIntervalSince(lastTap) < 0.35 {
        pending?.cancel()
        handleDouble(combination)
        lastCode = nil
        return
    }
    lastCode = combination
    lastTap = now
    let work = DispatchWorkItem { [weak self] in self?.handleSingle(combination) }
    pending = work
    DispatchQueue.main.asyncAfter(deadline: .now() + 0.35, execute: work)
}
```

## Typing and in-app actions

The SDK does not synthesize OS key presses. Two different jobs:

- **Type into a text field:** `setTAPInputMode(.text(), forIdentifiers:)`. The Tap is the keyboard. Your delegate will not see those taps.
- **Trigger an in-app action:** stay in controller mode and switch on `combination` in `tapped`.

Do not add a library that injects global keystrokes. iOS apps cannot drive other apps that way.

## Haptic feedback

```swift
TAPKit.sharedKit.vibrate(durations: [80], forIdentifiers: [identifier])
TAPKit.sharedKit.vibrate(durations: [100, 100, 100], forIdentifiers: nil) // on, pause, on
```

Values are milliseconds, quantized to 10 ms, maximum 18 values. `nil` identifiers vibrate every connected device. Delegate callbacks are already on the main queue, so call `vibrate` directly.

## Docs

- Input modes and the combination table: `README.md` in the SDK repository
- Sample: `TAPKit-Example/ViewController.swift`

Versions

The database has no other skills named tapkit-tapping.

Database snapshot: 13.11.2026 · package version 5f099b992d92 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100tap-tapping
    Decode Tap tapcodes (which fingers tapped), map finger combinations to app actions or keyboard shortcuts, and give haptic feedback. Use for tapping, finger combos, chords, tap-to-action, shortcuts, input modes, or the TAPPING vision model.
  • 100tap-android-tapping
    Decode Tap tapcodes on Android (which fingers tapped), map finger combinations to app actions, and give haptic feedback. Use for tapping, finger combos, chords, tap-to-action, classic input modes, or the framed TAPPING model. Start from tap-android-getting-started:…
  • 100tapkit-ios-sdk
    Integrate and use TAPKit, the TAP iOS SDK, to receive input from TAP Bluetooth devices (Tap Strap, TapXR, TapBand): finger-tap combinations, air-mouse movement, air gestures, raw sensor streams, haptics, and TapXR / TapBand device configuration. Use when writing…
  • 100tapkit-getting-started
    First skill for any TAP iOS app. The order is add TAPKit and NSBluetoothAlwaysUsageDescription, pair the Tap in Settings, addDelegate, setDefaultTAPInputMode (and setDefaultTAPXRState for TapXR), then start(). start() alone delivers no taps. Use for adding the SDK, pairing,…
  • 100tap-vision-models
    Switch the TapXR / TapBand vision model between TAPPING and AIR_GESTURE, set the op mode, and decode UnifiedAirGestures (swipes, pinches, holds, fist). Use for air gestures, pinch, swipe, fist, model switching, or AirGestures on Tap Strap.
  • 95tap-android-vision-models
    Switch a Tap vision model on Android between TAPPING and AIR_GESTURE, decode raw UnifiedAirGesture (swipes, pinches, holds, fist), and handle processed XRAirGesture (click, drag, drop, fist, swipe). Use for air gestures, pinch, swipe, fist, model switching, or classic…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.