Module ff

Module ff 

Source
Expand description

Force-feedback support.

evdev force feedback support is modeled after the USB Physical Input Device (PID) Class.

In general, there is no guarantee that any given driver or device will support all features or respect all Effect fields. If you intend to craft immersive experiences with haptic feedback, per-device testing may be necessary.

Effects are organized as follows:

All effect types can be represented as Effect, and also in a matchable enum EffectKind. The usual conversions via Into/From are supported.

§Usage

Support for force-feedback features can be queried via Evdev::supported_ff_features. The number of supported effects that can be stored at the same time can be queried via Evdev::supported_ff_effects.

An appropriate effect can then be uploaded by calling Evdev::upload_ff_effect, returning the EffectId assigned by the kernel.

The uploaded effect can then be triggered via Evdev::control_ff, or erased by calling Evdev::erase_ff_effect.

Structs§

Condition
An effect that applies conditionally and gradually as an axis is moved.
Constant
An effect that applies a constant force.
Damper
Damps movement along an axis.
Effect
A force-feedback effect description.
EffectId
Identifier for uploaded effects.
EffectType
A force-feedback effect type.
Envelope
An effect envelope.
Feature
Force feedback feature flags.
Friction
Applies friction to an axis as it is moved.
Inertia
Resists changes of velocity.
Periodic
A periodic waveform effect.
Ramp
An effect that ramps up or down over time.
Replay
Configures how an Effect should be scheduled.
Rumble
A vibration effect.
Spring
Makes an axis spring back to its center when moved.
Trigger
Configures which button triggers an effect (if any).
Waveform
List of waveform types for Periodic effects.

Enums§

EffectKind
List of supported force-feedback effects.