Gestures

From moasq/nanowave · View interactive version

Gestures is an AI agent skill from the GitHub repository moasq/nanowave. tvOS gesture patterns: Siri Remote input handling with onMoveCommand, onPlayPauseCommand, onExitCommand, swipe recognition. Use when implementing tvOS input handling, remote control interactions, or focus-based gestures. Triggers: gesture, Siri Remote, onMoveCommand, swipe, remote.

How to use this skill

Skill file

Gestures (tvOS)

tvOS does NOT support touch gestures. All input comes from the Siri Remote.

Siri Remote Commands

DIRECTIONAL INPUT:

.onMoveCommand { direction in
    switch direction {
    case .up: moveUp()
    case .down: moveDown()
    case .left: moveLeft()
    case .right: moveRight()
    @unknown default: break
    }
}

PLAY/PAUSE BUTTON:

.onPlayPauseCommand {
    togglePlayback()
}

MENU/BACK BUTTON:

.onExitCommand {
    dismiss()
}

SELECT (CLICK) BUTTON:

LONG PRESS:

.onLongPressGesture(minimumDuration: 0.5) {
    showContextOptions()
}

Swipe Recognition (Siri Remote touchpad)

.gesture(
    DragGesture(minimumDistance: 50)
        .onEnded { value in
            if abs(value.translation.width) > abs(value.translation.height) {
                if value.translation.width > 0 {
                    swipeRight()
                } else {
                    swipeLeft()
                }
            }
        }
)

NOT Available on tvOS

Rules

  1. Primary interaction is focus movement + select — not swipe
  2. Use onMoveCommand for directional navigation, not drag gestures
  3. Always handle onExitCommand for back navigation
  4. Siri Remote swipes are secondary — focus navigation is primary
  5. All interactive elements must work with focus + select pattern
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.