simvx.core.input.prompts¶
What to print on screen for an input, on the device the player is holding.
A pad’s controls are positional: Controller.A is the bottom face button on
every controller. What is printed on that button is not. It says A
on an Xbox pad, Cross on a PlayStation pad and B on a Nintendo one, because
Nintendo’s face buttons are laid out the other way round, so a game that draws
“Press A” draws the wrong letter for two of the three. That swap is the whole
reason this module exists; the rest is spelling.
Input.prompt("jump") is the ordinary entry point: it picks the binding that
matches whatever the player is using and labels it. The two functions below are
for a game drawing its own prompt for a button it names directly.
Module Contents¶
Functions¶
What family prints on button. |
|
What family prints on axis, optionally for one half of its travel. |
|
A combo the engine spells |
|
What to print for a pointer or tablet button, through the layout of the device that has it. |
|
What to print for one key, with no modifiers. |
Data¶
API¶
- simvx.core.input.prompts.__all__¶
[‘axis_label’, ‘button_label’, ‘key_binding_label’, ‘key_label’, ‘pointer_button_label’]
- simvx.core.input.prompts.button_label(button: simvx.core.input.controls.DeviceButton, family: simvx.core.input.enums.ControllerFamily = ControllerFamily.GENERIC) str[source]¶
What family prints on button.
A :attr:
~.enums.ControllerFamily.JOYSTICKhas no face buttons the engine can name, so it falls back to the generic spelling rather than inventing one.
- simvx.core.input.prompts.axis_label(axis: simvx.core.input.controls.DeviceAxis, family: simvx.core.input.enums.ControllerFamily = ControllerFamily.GENERIC, *, positive: bool | None = None) str[source]¶
What family prints on axis, optionally for one half of its travel.
positivenames a direction: a binding splits a stick axis in two, and “Left Stick Right” is what that half of it is called. Left None the whole axis is named. A trigger has one direction and ignores it.
- simvx.core.input.prompts.key_binding_label(key_combo: str) str[source]¶
A combo the engine spells
"shift+tab", as a player would read it.
- simvx.core.input.prompts.pointer_button_label(button: simvx.core.input.controls.DeviceButton) str[source]¶
What to print for a pointer or tablet button, through the layout of the device that has it.
A role prints as the mouse’s member of it, which is what a prompt for a player at a desk wants; any other button prints as its own device type does, and as the device plugged in does where there is one, so a rebind screen reads what the player’s own hardware calls the button.
- simvx.core.input.prompts.key_label(key: simvx.core.input.controls.DeviceButton) str[source]¶
What to print for one key, with no modifiers.