---
name: "SDL_HapticCondition"
section: "3type"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_HapticCondition"
---

# SDL\_HapticCondition(3type)

A structure containing a template for a Condition effect.

## NAME

SDL\_HapticCondition - A structure containing a template for a Condition effect.

## HEADER FILE

Defined in SDL3/SDL\_haptic.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**typedef struct SDL\_HapticCondition** **{**     **/\* Header \*/**     **Uint16 type;            /\*\*\< SDL\_HAPTIC\_SPRING, SDL\_HAPTIC\_DAMPER,**                                  **SDL\_HAPTIC\_INERTIA or SDL\_HAPTIC\_FRICTION \*/**     **SDL\_HapticDirection direction;  /\*\*\< Direction of the effect. \*/**     **/\* Replay \*/**     **Uint32 length;          /\*\*\< Duration of the effect. \*/**     **Uint16 delay;           /\*\*\< Delay before starting the effect. \*/**     **/\* Trigger \*/**     **Uint16 button;          /\*\*\< Button that triggers the effect. \*/**     **Uint16 interval;        /\*\*\< How soon it can be triggered again after button. \*/**     **/\* Condition \*/**     **Uint16 right\_sat\[3\];    /\*\*\< Level when joystick is to the positive side; max 0xFFFF. \*/**     **Uint16 left\_sat\[3\];     /\*\*\< Level when joystick is to the negative side; max 0xFFFF. \*/**     **Sint16 right\_coeff\[3\];  /\*\*\< How fast to increase the force towards the positive side. \*/**     **Sint16 left\_coeff\[3\];   /\*\*\< How fast to increase the force towards the negative side. \*/**     **Uint16 deadband\[3\];     /\*\*\< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. \*/**     **Sint16 center\[3\];       /\*\*\< Position of the dead zone. \*/** **} SDL\_HapticCondition;**

## DESCRIPTION

The struct handles the following effects:

•  **SDL\_HAPTIC\_SPRING** : Effect based on axes position.

•  **SDL\_HAPTIC\_DAMPER** : Effect based on axes velocity.

•  **SDL\_HAPTIC\_INERTIA** : Effect based on axes\
   acceleration.

•  **SDL\_HAPTIC\_FRICTION** : Effect based on axes\
   movement.

Direction is handled by condition internals instead of a direction member. The condition effect specific members have three parameters. The first refers to the X axis, the second refers to the Y axis and the third refers to the Z axis. The right terms refer to the positive side of the axis and the left terms refer to the negative side of the axis. Please refer to the

**SDL\_HapticDirection**\
  diagram for which side is positive and which is negative.

## AVAILABILITY

This struct is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_HapticDirection**(3type)](/SDL_HapticDirection/3type.md), **•**(3), [**SDL\_HAPTIC\_SPRING**(3)](/SDL_HAPTIC_SPRING/3.md), **•**(3), [**SDL\_HAPTIC\_DAMPER**(3)](/SDL_HAPTIC_DAMPER/3.md), **•**(3), [**SDL\_HAPTIC\_INERTIA**(3)](/SDL_HAPTIC_INERTIA/3.md), **•**(3), [**SDL\_HAPTIC\_FRICTION**(3)](/SDL_HAPTIC_FRICTION/3.md), **•**(3), [**SDL\_HapticEffect**(3type)](/SDL_HapticEffect/3type.md)
