libretro.drivers.led.dict

A LED driver that stores LED state in a dictionary.

See also

libretro.api.led

Defines the LED interface structure this driver implements.

Classes

DictLedDriver

A LedDriver that stores LED states in an in-memory dict.

class DictLedDriver[source]

Bases: LedDriver

A LedDriver that stores LED states in an in-memory dict.

__init__()[source]

Initialize the driver with an empty LED-state dictionary.

set_led_state(led, state)[source]
Parameters:
  • led (int) – Zero-based LED index.

  • state (int) – Non-zero to turn the LED on, zero to turn it off.

Return type:

None

get_led_state(led)[source]
Parameters:

led (int) – Zero-based LED index.

Return type:

int

Returns:

The stored LED state, or 0 if the LED has never been set.

self[key]

Return the current state of a virtual LED. Equivalent to get_led_state().

Parameters:

key (int) – Zero-based LED index.

Return type:

int

Returns:

The LED state (non-zero means on).

classmethod __new__(*args, **kwargs)
self[key] = value

Set the state of a virtual LED. Equivalent to set_led_state().

Parameters:
  • key (int) – Zero-based LED index.

  • value (int) – Non-zero to turn the LED on, zero to turn it off.