libretro.drivers.led.driver

Protocol definition for the LED driver interface.

See also

libretro.api.led

Provides the LED interface structure that LedDriver implementations use.

Classes

LedDriver

Protocol for drivers that track the state of virtual LEDs exposed to the core.

class LedDriver[source]

Bases: Protocol

Protocol for drivers that track the state of virtual LEDs exposed to the core.

Cores control LED state via RETRO_ENVIRONMENT_GET_LED_INTERFACE.

See also

retro_led_interface

The C interface struct that this protocol abstracts over.

abstractmethod set_led_state(led, state)[source]

Set the state of a virtual LED.

Corresponds to retro_set_led_state_t.

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

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

Return type:

None

self[key] = value[source]

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.

abstractmethod get_led_state(led)[source]

Return the current state of a virtual LED.

Parameters:

led (int) – Zero-based LED index.

Return type:

int

Returns:

The LED state (non-zero means on).

self[key][source]

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).

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