Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

tapkit-tapping

/tapkit-tapping

Dekoduje kombinacje palców TAP, mapuje je na akcje w aplikacji, wykrywa podwójne stuknięcia i daje haptykę.

Repozytorium
tap-ios-sdk ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
21.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

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

Co robi i kiedy

Dekoduje kombinacje palców TAP, mapuje je na akcje w aplikacji, wykrywa podwójne stuknięcia i daje haptykę.

Oryginalny opis (EN)

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.

Jak działa

  1. Combination bitmask
  2. Turn on tap events
  3. Double taps
  4. Typing and in-app actions
  5. Haptic feedback
  6. Docs
Sekcje z nagłówków SKILL.md, w oryginale · 103 linii, 558 słów
Podgląd SKILL.md
---
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`

Wersje

W bazie nie ma innych skilli o nazwie tapkit-tapping.

Migawka bazy z 13.11.2026 · wersja paczki 5f099b992d92 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 3 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100tap-tapping
    Dekoduje tapcody Tap, czyli które palce stuknęły, mapuje kombinacje palców na akcje lub skróty klawiszowe i daje haptykę.
  • 100tap-android-tapping
    Dekoduje tapcody Tap na Androidzie, czyli które palce stuknęły, mapuje kombinacje palców na akcje i daje haptyczną informację zwrotną.
  • 100tapkit-ios-sdk
    Integruje TAPKit, SDK dla iOS, z urządzeniami TAP przez Bluetooth: kombinacje palców, ruch, gesty i surowe czujniki.
  • 100tapkit-getting-started
    Prowadzi przez start aplikacji iOS z TAPKit: dodanie SDK, parowanie w Ustawieniach, delegat i uruchomienie, bo samo start() nie dostarcza zdarzeń.
  • 100tap-vision-models
    Przełącza model wizyjny TapXR lub TapBand między TAPPING a AIR_GESTURE i dekoduje gesty w powietrzu: przesunięcia, szczypnięcia i pięść.
  • 95tap-android-vision-models
    Przełącza modele wizyjne Tap na Androidzie i dekoduje gesty powietrzne: przeciągnięcia, szczypnięcia, pięść i przytrzymania.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.