libretro.drivers.rumble.dict

RumbleDriver implementation that tracks per-port motor strengths in a dictionary.

See also

RumbleDriver

The protocol this driver implements.

Classes

DictRumbleDriver

A RumbleDriver implementation that stores rumble state in a dictionary.

RumbleState

Simulated state of a pair of rumble motors.

class DictRumbleDriver[source]

Bases: RumbleDriver

A RumbleDriver implementation that stores rumble state in a dictionary.

__init__()[source]

Initialize the driver with an empty per-port rumble state map.

set_rumble_state(port, effect, strength)[source]

Set the rumble state of a controller port.

Return type:

bool

self[port][source]

Get the state of the virtual rumble motors for a controller port.

Parameters:

port (Port (int)) – The controller port to get the rumble state for.

Return type:

RumbleState

Returns:

The rumble state for the controller port.

classmethod __new__(*args, **kwargs)
class RumbleState[source]

Bases: object

Simulated state of a pair of rumble motors.

strong
weak
self[item][source]

Return the strength of the motor identified by item.

Return type:

int

self[key] = value[source]

Set the strength of the motor identified by key.

len(self)[source]

Return the number of motors (always 2: one strong, one weak).

__init__(strong, weak)
classmethod __new__(*args, **kwargs)