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 tovalue
.value
refers to afloat
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 ainput.ButtonId
to refer to left or right transmitter and it should bestr
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 beNone
if and only ifkey
is a str. Otherwise you will refer to the transmitter correspondinghand
. Ifid
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()
withhand
set toinput.Hand.LEFT
and passingbutton_id
askey
- static press_right(button_id: inputs.ButtonId, value: float, id: int = 0)
Alias for
press()
withhand
set toinput.Hand.RIGHT
and passingbutton_id
askey
- static press_custom(key: str, value: float)
Alias for
press()
withhand
set 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.