STRUCT FF_EFFECT(9)
π 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, orFF_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 offf_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms