inputs.Transmitters

class inputs.Transmitters

A utility class for accessing transmitters without a reference.

static left_transmitter(id: int = 0) inputs.TransmitterReference

Use this to get a left handed transmitter. The id parameter is zero indexed.

static right_transmitter(id: int = 0) inputs.TransmitterReference

Use this to get a right handed transmitter. The id parameter is zero indexed.

static custom_transmitter() inputs.TransmitterReference

Use this to get a custom (i.e. keyboard) transmitter.

static press(key: Union[inputs.ButtonId, str], value: float, hand: Optional[inputs.Hand], id: int = 0)

Use this to set the key of a transmitter to value. value refers to a float between 0 and 1 where 0 refers to button not being pressed and 1 being fully pressed. The key will retain its value until you call this method again. The value that the transmitter uses is the maximum of the value that is set here and the value from the real physical controller.

key should be supplied as a input.ButtonId to refer to left or right transmitter and it should be str to refer to a custom (i.e keyboard) transmitter. In the later case, it should be a single ascii letter corresponding to the key being set.

hand referes to the hand of the transmitter on which you want to set a key. hand should be None if and only if key is a str. Otherwise you will refer to the transmitter corresponding hand. If id is 0 you refer to the first or topmost transmitter corresponding to that hand, if it is 1 one you will get the next and so on.

static press_left(button_id: inputs.ButtonId, value: float, id: int = 0)

Alias for press() with hand set to input.Hand.LEFT and passing button_id as key

static press_right(button_id: inputs.ButtonId, value: float, id: int = 0)

Alias for press() with hand set to input.Hand.RIGHT and passing button_id as key

static press_custom(key: str, value: float)

Alias for press() with hand set to None

static stream(key: Union[inputs.ButtonId, str], hand: Optional[inputs.Hand], id: int = 0) streams.Stream[float]

Returns a stream of input values from this transmitter for the key key.

static reset()

Use this to clear any keys that are being pressed from code.