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
idparameter is zero indexed.
- static right_transmitter(id: int = 0) inputs.TransmitterReference
Use this to get a right handed transmitter. The
idparameter 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
keyof a transmitter tovalue.valuerefers to afloatbetween 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.keyshould be supplied as ainput.ButtonIdto refer to left or right transmitter and it should bestrto 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.handreferes to the hand of the transmitter on which you want to set a key.handshould beNoneif and only ifkeyis a str. Otherwise you will refer to the transmitter correspondinghand. Ifidis 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()withhandset toinput.Hand.LEFTand passingbutton_idaskey
- static press_right(button_id: inputs.ButtonId, value: float, id: int = 0)
Alias for
press()withhandset toinput.Hand.RIGHTand passingbutton_idaskey
- static press_custom(key: str, value: float)
Alias for
press()withhandset toNone
- 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.