libretro.drivers.sensor.driver¶
Protocol definition for accelerometer/gyroscope sensor drivers.
See also
libretro.api.sensorThe matching
ctypestypes and callback definitions.
Classes
Describes the interface for input from a device's sensors. |
- class SensorDriver[source]¶
Bases:
ProtocolDescribes the interface for input from a device’s sensors.
Note
Corresponds to
RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE.- abstractmethod set_sensor_state(port, action, rate)[source]¶
Configure a sensor on a port, possibly with a specific query rate.
Corresponds to
retro_set_sensor_state_t.Note
The
EnvironmentDrivershould validateportagainst the maximum number of players (if any), skipping this method and returningFalseif the port is invalid.- Parameters:
port (
Port(int)) – The input port to configure the sensors for.action (
SensorAction) – The action to perform on the sensor.rate (
int) – The rate at which to query the sensor.
- Return type:
- Returns:
Whether the sensor was successfully configured.
- abstractmethod get_sensor_input(port, sensor)[source]¶
Corresponds to
retro_sensor_get_input_t.- Return type:
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶