Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.9
    Preparing search index...

    Function useTouchControls

    • Custom hook for handling touch controls and gesture recognition

      Features:

      • Swipe detection (horizontal and vertical)
      • Two-finger tap detection for vital point mode
      • Single tap detection
      • Tactical step gestures (tap) vs continuous walk (hold)
      • Distance calculation for swipe intensity
      • Configurable thresholds
      • Haptic feedback for tactical steps

      Gesture Mapping:

      • Swipe Right: Advance toward opponent
      • Swipe Left: Retreat from opponent
      • Swipe Up: High stance mode
      • Swipe Down: Low stance mode
      • Two-Finger Tap: Activate vital point targeting mode
      • Single Tap (directional): Tactical 30cm step (전술적 발걸음)
      • Hold (directional): Continuous walk movement

      Parameters

      Returns UseTouchControlsReturn

      const { isTouching } = useTouchControls({
      onGesture: (gesture) => {
      switch (gesture.type) {
      case 'tap-forward':
      handleTacticalStep('forward'); // 전진보법
      break;
      case 'hold-forward':
      handleContinuousWalk('forward');
      break;
      case 'two-finger-tap':
      activateVitalPointMode();
      break;
      }
      },
      enabled: !isPaused,
      holdThreshold: 200, // 200ms to distinguish tap from hold
      enableHaptics: true,
      });

      터치컨트롤사용