STRUCT FF_EFFECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ struct ff_effect β€” defines force feedback effect πŸ‘‘

okay bestie, welcome to the Kernel API Manual page for struct ff_effect, and honestly? this one's kind of a big deal β€” it's literally the struct that defines a force feedback effect. main character energy fr fr πŸ’…


✨ SYNOPSIS ✨

struct ff_effect {
    __u16 type;
    __s16 id;
    __u16 direction;
    struct ff_trigger trigger;
    struct ff_replay replay;
    union {
      struct ff_constant_effect constant;
      struct ff_ramp_effect ramp;
      struct ff_periodic_effect periodic;
      struct ff_condition_effect condition[2];
      struct ff_rumble_effect rumble;
      struct ff_haptic_effect haptic;
    } u;
 };

πŸŽ€ MEMBERS πŸŽ€

  • type β€” the type of the effect, and it's giving ✨options✨: FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM.
  • id β€” an unique id assigned to an effect. yes bestie, an unique, that's what the page says 🫢
  • direction β€” direction of the effect.
  • trigger β€” trigger conditions (struct ff_trigger).
  • replay β€” scheduling of the effect (struct ff_replay).
  • u β€” the effect-specific structure, one of ff_constant_effect, ff_ramp_effect, ff_periodic_effect, ff_condition_effect, ff_rumble_effect, further defining effect parameters.

πŸ’… DESCRIPTION πŸ’…

so this structure is sent through ioctl from the application to the driver β€” that's the whole vibe. to create a new effect, the application should set its id to -1, and the kernel will return the assigned id, which can later be used to update or delete this effect. lowkey iconic of the kernel ngl 😌

the direction of the effect is encoded as follows:

  • 0 deg -> 0x0000 (down)
  • 90 deg -> 0x4000 (left)
  • 180 deg -> 0x8000 (up)
  • 270 deg -> 0xC000 (right)
🚨 no cap: those direction values are exact, don't go freestyling them. the kernel will not be amused.

🌈 SEE ALSO 🌈

  • Kernel file ./include/uapi/linux/input.h
  • struct input_absinfo(9)
  • struct input_keymap_entry(9)
  • EVIOCGMTSLOTS(9)
  • EVIOCGMASK(9)
  • EVIOCSMASK(9)
  • struct ff_replay(9)
  • struct ff_trigger(9)
  • struct ff_envelope(9)
  • struct ff_constant_effect(9)
  • struct ff_ramp_effect(9)
  • struct ff_condition_effect(9)
  • struct ff_periodic_effect(9)
  • struct ff_rumble_effect(9)
  • struct ff_haptic_effect(9)

that's the whole page bestie, go forth and make things rumble πŸ’–βœ¨πŸ¦‹

sign-off szn: this little masterpiece lives under ./include/uapi/linux, and it's dated October 2026 β€” literally from the future, we love that for us πŸŽ€πŸ’œ

πŸ“¦ where this page comes from