libretro.api.rumble

Rumble (force feedback) interface types.

Corresponds to retro_rumble_interface in libretro.h.

See also

RumbleDriver

The Protocol that uses these types to implement rumble support in libretro.py.

libretro.drivers.rumble

libretro.py’s included RumbleDriver implementations.

Module Attributes

retro_rumble_effect

Corresponds to retro_rumble_effect in libretro.h.

retro_set_rumble_state_t

Set the rumble intensity for one motor of a controller.

Classes

RumbleEffect

Enumeration of rumble motor types.

retro_rumble_interface

Interface for a Core to provide rumble (force feedback) support.

retro_set_rumble_state_t

Set the rumble intensity for one motor of a controller.

Registered by the frontend and called by the core. Each controller has independent strong and weak motors; setting one does not override the other.

Parameters:
  • port – Index of the controller port to address.

  • effect – A RumbleEffect selecting the strong or weak motor.

  • strength – Desired motor intensity, in the range [0, 0xFFFF].

Returns:

True if the rumble state was honored, False if the controller does not support rumble.

Corresponds to retro_set_rumble_state_t in libretro.h.

See also

RumbleDriver.set_rumble_state

The suggested entry point for implementing rumble support in a core.

class RumbleEffect[source]

Bases: IntEnum

Enumeration of rumble motor types.

>>> from libretro.api import RumbleEffect
>>> RumbleEffect.STRONG
<RumbleEffect.STRONG: 0>
STRONG = 0
WEAK = 1
__new__(value)
classmethod value in self

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod self[name]

Return the member matching name.

__init__()
classmethod iter(self)

Return members in definition order.

classmethod len(self)

Return the number of members (no aliases)

class retro_rumble_interface[source]

Bases: Structure

Interface for a Core to provide rumble (force feedback) support.

Corresponds to retro_rumble_interface in libretro.h.

set_rumble_state

Sets the rumble intensity for the controller assigned to a given input port.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
__deepcopy__(_)[source]

Return copy of this object. Intended for use with copy.deepcopy().

retro_rumble_effect

Corresponds to retro_rumble_effect in libretro.h.