simvx.core.input.controls¶
Controls: every button and axis of every device, as one shape of value.
An input is a control of a device type: Key.SPACE, Mouse.LEFT,
Pen.BARREL_1, Tablet.RING, Tablet.button(11). There is no bare
A or LEFT: a name exists only relative to its device type, and the
namespaces below (:class:Key, :class:Mouse, :class:Touch, :class:Pen,
- class:
Tablet, :class:Controller, :class:Pointer) hold the named ones and build the rest.
A control is (device type, name) or (device type, index), optionally
pinned to one unit with :meth:DeviceControl.on. A device reports its
buttons and axes by index and its layout
(:mod:simvx.core.input.layouts) names them, so an event carries the named
control where the layout has a name and the index form where it has none.
Controls are interned: building one with the same parts twice returns the
same object. So equality is identity, event.key is Key.S and
event.button == Mouse.LEFT agree, and a control is a cheap dict key and set
member.
Pointer.PRIMARY and Pointer.SECONDARY are roles: controls of the
abstract pointer device type that the mouse, a pen and a finger inherit. A role
is a group, answered with in::
event.button in Pointer.PRIMARY # a left click, a pen tip or a finger
Mouse.LEFT != Pointer.PRIMARY # a control is not the group it belongs to
Module Contents¶
Classes¶
What kind of device has a control. |
|
One control of one device type: a button, an axis or a stick. |
|
A button: a key, a mouse or pen button, a finger’s contact, a tablet’s express key. |
|
An axis: a stick’s or a trigger’s travel, a tablet’s ring or strip. |
|
Two axes that move together: a controller’s stick. |
|
A device type’s controls: the named ones as attributes, the rest built by index. |
|
The keyboard’s keys, by physical position. |
|
The mouse’s buttons and its wheel. A pen’s barrel is never one: bind |
|
A finger’s contact with the glass, and the gestures fingers make together. |
|
A pen’s buttons. The eraser is not here: it is a tool ( |
|
A tablet’s own controls: express keys by index, and the rings and strips a layout names. |
|
A pad’s controls, by position: |
|
The roles every pointer inherits: its main press and its alternate press. |
Functions¶
The roles control belongs to: |
|
The physical position key is on the engine’s key table, or None for a control that is not a key. |
|
The key at platform code code: the named one where the table has it, else |
|
The combo spelling of one key: |
|
Every key a combo name can mean: |
Data¶
API¶
- simvx.core.input.controls.__all__¶
[‘DeviceAxis’, ‘DeviceButton’, ‘DeviceControl’, ‘DeviceControls’, ‘DeviceStick’, ‘DeviceType’, ‘Cont…
- class simvx.core.input.controls.DeviceType[source]¶
Bases:
enum.StrEnumWhat kind of device has a control.
A pointer’s type has the same spelling as its
- Class:
~simvx.core.input.enums.PointerType, so one converts to the other by value. :attr:POINTERis abstract: no device is one, and the mouse, a pen and a finger inherit its controls, the roles.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- KEYBOARD¶
‘keyboard’
- MOUSE¶
‘mouse’
- TOUCH¶
‘touch’
- PEN¶
‘pen’
- TABLET¶
‘tablet’
- CONTROLLER¶
‘controller’
- POINTER¶
‘pointer’
- __new__(*values)¶
- __add__()¶
- __contains__()¶
- __delattr__()¶
- __dir__()¶
- __eq__()¶
- __format__()¶
- __ge__()¶
- __getattribute__()¶
- __getitem__()¶
- __getnewargs__()¶
- __getstate__()¶
- __gt__()¶
- __hash__()¶
- __iter__()¶
- __le__()¶
- __len__()¶
- __lt__()¶
- __mod__()¶
- __mul__()¶
- __ne__()¶
- __reduce__()¶
- __reduce_ex__()¶
- __repr__()¶
- __rmod__()¶
- __rmul__()¶
- __setattr__()¶
- __sizeof__()¶
- __str__()¶
- __subclasshook__()¶
- capitalize()¶
- casefold()¶
- center()¶
- count()¶
- encode()¶
- endswith()¶
- expandtabs()¶
- find()¶
- format()¶
- format_map()¶
- index()¶
- isalnum()¶
- isalpha()¶
- isascii()¶
- isdecimal()¶
- isdigit()¶
- isidentifier()¶
- islower()¶
- isnumeric()¶
- isprintable()¶
- isspace()¶
- istitle()¶
- isupper()¶
- join()¶
- ljust()¶
- lower()¶
- lstrip()¶
- partition()¶
- removeprefix()¶
- removesuffix()¶
- replace()¶
- rfind()¶
- rindex()¶
- rjust()¶
- rpartition()¶
- rsplit()¶
- rstrip()¶
- split()¶
- splitlines()¶
- startswith()¶
- strip()¶
- swapcase()¶
- title()¶
- translate()¶
- upper()¶
- zfill()¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.input.controls.DeviceControl[source]¶
One control of one device type: a button, an axis or a stick.
Exactly one of :attr:
nameand :attr:indexis set. :attr:unit, when set, pins the control to one device, the engine’s id for it.Built through the namespaces rather than by hand:
Mouse.LEFT,Tablet.button(11),Controller.A.on(pad). Interned, immutable and hashable.- __slots__¶
(‘device’, ‘index’, ‘name’, ‘unit’)
- device: simvx.core.input.controls.DeviceType¶
None
- name: str | None¶
None
- index: int | None¶
None
- unit: int | None¶
None
- __new__(device: simvx.core.input.controls.DeviceType | str, name: str | None = None, *, index: int | None = None, unit: int | None = None) Self[source]¶
- on(device: object) Self[source]¶
This control on one unit only: an
InputDevice, or its id.Controller.A.on(pad)is player two’s A in local co-op; a binding on it hears that pad and no other.on(None)is the control on any unit.
- property is_named: bool[source]¶
Whether a layout name, rather than an index, identifies this control.
- __str__() str[source]¶
The written spelling a rebind file stores:
"mouse:left","tablet:button(11)".The unit is not part of it: a file keys a unit by the device’s guid or serial, never by the engine’s id, which means nothing in another run.
- static parse(spelling: str) simvx.core.input.controls.DeviceControl[source]¶
The control a written spelling names, as :meth:
__str__writes it."mouse:left","tablet:button(11)","controller:left_x.positive","tablet:ring.delta","pointer:primary". A name the device type does not have raises, naming the ones it does, so a misspelt control in a file is an error rather than a binding that never fires.
- __mul__(factor: float) Any[source]¶
This control’s value multiplied into an action’s unit:
Mouse.WHEEL * 0.1.A whole axis or a stick keeps its sign and direction, so the product is the composite an action reads it as, each part scaled.
- __rmul__¶
None
- class simvx.core.input.controls.DeviceButton[source]¶
Bases:
simvx.core.input.controls.DeviceControlA button: a key, a mouse or pen button, a finger’s contact, a tablet’s express key.
A button of the abstract pointer type is a role, a group of buttons on the device types that inherit it:
event.button in Pointer.PRIMARY. A concrete button contains itself and nothing else, soevent.button in targetis one test whichever the target is.- __slots__¶
()
- __contains__(control: object) bool[source]¶
Whether control is this one, or a member of it where this is a group.
A group is a button that stands for several:
Pointer.PRIMARYfor a left click, a pen tip and a finger,Key.CTRLfor either Control key. A concrete control contains itself alone. A member on a unit is still a member.
- property is_role: bool[source]¶
Whether this is a role of the abstract pointer rather than one device type’s button.
- property is_group: bool[source]¶
Whether this stands for several controls: a pointer role, or a modifier’s two sides.
- property members: frozenset[simvx.core.input.controls.DeviceButton][source]¶
The controls this group stands for; a concrete control is its own only member.
- __add__(other: simvx.core.input.controls.DeviceButton | simvx.core.input.controls.DeviceAxis) simvx.core.input.events.InputBinding[source]¶
A chord: other pressed while this is held.
Key.CTRL + Key.S,Controller.LB + Controller.A.
- device: simvx.core.input.controls.DeviceType¶
None
- name: str | None¶
None
- index: int | None¶
None
- unit: int | None¶
None
- __new__(device: simvx.core.input.controls.DeviceType | str, name: str | None = None, *, index: int | None = None, unit: int | None = None) Self¶
- __setattr__(name: str, value: object) None¶
- __delattr__(name: str) None¶
- __reduce__() tuple¶
- __copy__() Self¶
- __deepcopy__(memo: dict) Self¶
- on(device: object) Self¶
- property is_named: bool¶
- __str__() str¶
- __repr__() str¶
- static parse(spelling: str) simvx.core.input.controls.DeviceControl¶
- __mul__(factor: float) Any¶
- __rmul__¶
None
- per_second(rate: float) Any¶
- class simvx.core.input.controls.DeviceAxis[source]¶
Bases:
simvx.core.input.controls.DeviceControlAn axis: a stick’s or a trigger’s travel, a tablet’s ring or strip.
Three forms of one axis are controls of their own, for what a binding needs to say:
- attr:
positiveand :attr:negative: one half of the travel. AnAxis2Ddirection binds a half, and so does a button action driven by a trigger.
- attr:
delta: the motion this frame rather than the position, so a ring bound this way is a scroll wheel and bound plainly is a dial.
- __slots__¶
(‘half’, ‘is_delta’)
- half: int¶
None
- is_delta: bool¶
None
- __new__(device: simvx.core.input.controls.DeviceType | str, name: str | None = None, *, index: int | None = None, unit: int | None = None, half: int = 0, is_delta: bool = False) Self[source]¶
- property positive: simvx.core.input.controls.DeviceAxis[source]¶
The half of this axis’s travel above zero: right on an x axis, down on a y axis.
- property negative: simvx.core.input.controls.DeviceAxis[source]¶
The half of this axis’s travel below zero.
- property delta: simvx.core.input.controls.DeviceAxis[source]¶
This axis read as its motion this frame rather than its position.
- property whole: simvx.core.input.controls.DeviceAxis[source]¶
This axis itself: both halves, read as its position, on any unit.
- device: simvx.core.input.controls.DeviceType¶
None
- name: str | None¶
None
- index: int | None¶
None
- unit: int | None¶
None
- __setattr__(name: str, value: object) None¶
- __delattr__(name: str) None¶
- __reduce__() tuple¶
- __copy__() Self¶
- __deepcopy__(memo: dict) Self¶
- on(device: object) Self¶
- property is_named: bool¶
- __str__() str¶
- static parse(spelling: str) simvx.core.input.controls.DeviceControl¶
- __mul__(factor: float) Any¶
- __rmul__¶
None
- per_second(rate: float) Any¶
- class simvx.core.input.controls.DeviceStick[source]¶
Bases:
simvx.core.input.controls.DeviceControlTwo axes that move together: a controller’s stick.
A stick in an action’s binding list is the
Axis2Dover its four halves, and its directions are controls of their own for a rebind screen:Controller.LEFT_STICK.rightisController.LEFT_X.positive.+yis down the screen, as everywhere in 2D.- __slots__¶
()
- property x: simvx.core.input.controls.DeviceAxis[source]¶
The stick’s horizontal axis, on this stick’s unit.
- property y: simvx.core.input.controls.DeviceAxis[source]¶
The stick’s vertical axis,
+ydown, on this stick’s unit.
- property up: simvx.core.input.controls.DeviceAxis[source]¶
- property down: simvx.core.input.controls.DeviceAxis[source]¶
- property left: simvx.core.input.controls.DeviceAxis[source]¶
- property right: simvx.core.input.controls.DeviceAxis[source]¶
- device: simvx.core.input.controls.DeviceType¶
None
- name: str | None¶
None
- index: int | None¶
None
- unit: int | None¶
None
- __new__(device: simvx.core.input.controls.DeviceType | str, name: str | None = None, *, index: int | None = None, unit: int | None = None) Self¶
- __setattr__(name: str, value: object) None¶
- __delattr__(name: str) None¶
- __reduce__() tuple¶
- __copy__() Self¶
- __deepcopy__(memo: dict) Self¶
- on(device: object) Self¶
- property is_named: bool¶
- __str__() str¶
- __repr__() str¶
- static parse(spelling: str) simvx.core.input.controls.DeviceControl¶
- __mul__(factor: float) Any¶
- __rmul__¶
None
- per_second(rate: float) Any¶
- class simvx.core.input.controls.DeviceControls[source]¶
A device type’s controls: the named ones as attributes, the rest built by index.
A namespace, not a type:
Mouse.LEFTis a :class:DeviceButton, and nothing is ever an instance ofMouse. Iterating one lists its named controls, which is what a rebind screen offers;x in Penasks whether x is a pen’s control.- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None[source]¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls[source]¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton[source]¶
The button at index on this device type, whatever the layout calls it.
For a button the layout does not name, such as the twelfth express key of a tablet nobody described:
Tablet.button(11). A binding on it hears that index; a binding on a name hears whichever index the layout puts the name at.
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis[source]¶
The axis at index on this device type, whatever the layout calls it.
- class simvx.core.input.controls.Key[source]¶
Bases:
simvx.core.input.controls.DeviceControlsThe keyboard’s keys, by physical position.
Key.Wis the key where W sits on a US board, so WASD is the same four positions on QWERTY and on AZERTY. The keyboard’s layout is fixed, which is why its keys cannot be overridden the way a pen’s barrels can: a key’s position already is the hardware fact, and moving what it does is a rebind. A platform code the table does not name isKey.button(code).- SPACE¶
‘_key(…)’
- APOSTROPHE¶
‘_key(…)’
- COMMA¶
‘_key(…)’
- MINUS¶
‘_key(…)’
- PERIOD¶
‘_key(…)’
- SLASH¶
‘_key(…)’
- KEY_0¶
‘_key(…)’
- KEY_1¶
‘_key(…)’
- KEY_2¶
‘_key(…)’
- KEY_3¶
‘_key(…)’
- KEY_4¶
‘_key(…)’
- KEY_5¶
‘_key(…)’
- KEY_6¶
‘_key(…)’
- KEY_7¶
‘_key(…)’
- KEY_8¶
‘_key(…)’
- KEY_9¶
‘_key(…)’
- SEMICOLON¶
‘_key(…)’
- EQUAL¶
‘_key(…)’
- A¶
‘_key(…)’
- B¶
‘_key(…)’
- C¶
‘_key(…)’
- D¶
‘_key(…)’
- E¶
‘_key(…)’
- F¶
‘_key(…)’
- G¶
‘_key(…)’
- H¶
‘_key(…)’
- I¶
‘_key(…)’
- J¶
‘_key(…)’
- K¶
‘_key(…)’
- L¶
‘_key(…)’
- M¶
‘_key(…)’
- N¶
‘_key(…)’
- O¶
‘_key(…)’
- P¶
‘_key(…)’
- Q¶
‘_key(…)’
- R¶
‘_key(…)’
- S¶
‘_key(…)’
- T¶
‘_key(…)’
- U¶
‘_key(…)’
- V¶
‘_key(…)’
- W¶
‘_key(…)’
- X¶
‘_key(…)’
- Y¶
‘_key(…)’
- Z¶
‘_key(…)’
- LEFT_BRACKET¶
‘_key(…)’
- BACKSLASH¶
‘_key(…)’
- RIGHT_BRACKET¶
‘_key(…)’
- GRAVE_ACCENT¶
‘_key(…)’
- ESCAPE¶
‘_key(…)’
- ENTER¶
‘_key(…)’
- TAB¶
‘_key(…)’
- BACKSPACE¶
‘_key(…)’
- INSERT¶
‘_key(…)’
- DELETE¶
‘_key(…)’
- RIGHT¶
‘_key(…)’
- LEFT¶
‘_key(…)’
- DOWN¶
‘_key(…)’
- UP¶
‘_key(…)’
- PAGE_UP¶
‘_key(…)’
- PAGE_DOWN¶
‘_key(…)’
- HOME¶
‘_key(…)’
- END¶
‘_key(…)’
- CAPS_LOCK¶
‘_key(…)’
- SCROLL_LOCK¶
‘_key(…)’
- NUM_LOCK¶
‘_key(…)’
- PRINT_SCREEN¶
‘_key(…)’
- PAUSE¶
‘_key(…)’
- F1¶
‘_key(…)’
- F2¶
‘_key(…)’
- F3¶
‘_key(…)’
- F4¶
‘_key(…)’
- F5¶
‘_key(…)’
- F6¶
‘_key(…)’
- F7¶
‘_key(…)’
- F8¶
‘_key(…)’
- F9¶
‘_key(…)’
- F10¶
‘_key(…)’
- F11¶
‘_key(…)’
- F12¶
‘_key(…)’
- KP_0¶
‘_key(…)’
- KP_1¶
‘_key(…)’
- KP_2¶
‘_key(…)’
- KP_3¶
‘_key(…)’
- KP_4¶
‘_key(…)’
- KP_5¶
‘_key(…)’
- KP_6¶
‘_key(…)’
- KP_7¶
‘_key(…)’
- KP_8¶
‘_key(…)’
- KP_9¶
‘_key(…)’
- KP_DECIMAL¶
‘_key(…)’
- KP_DIVIDE¶
‘_key(…)’
- KP_MULTIPLY¶
‘_key(…)’
- KP_SUBTRACT¶
‘_key(…)’
- KP_ADD¶
‘_key(…)’
- KP_ENTER¶
‘_key(…)’
- LEFT_SHIFT¶
‘_key(…)’
- LEFT_CONTROL¶
‘_key(…)’
- LEFT_ALT¶
‘_key(…)’
- LEFT_SUPER¶
‘_key(…)’
- RIGHT_SHIFT¶
‘_key(…)’
- RIGHT_CONTROL¶
‘_key(…)’
- RIGHT_ALT¶
‘_key(…)’
- RIGHT_SUPER¶
‘_key(…)’
- MENU¶
‘_key(…)’
- CTRL¶
‘DeviceButton(…)’
- SHIFT¶
‘DeviceButton(…)’
- ALT¶
‘DeviceButton(…)’
- META¶
‘DeviceButton(…)’
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis[source]¶
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- class simvx.core.input.controls.Mouse[source]¶
Bases:
simvx.core.input.controls.DeviceControlsThe mouse’s buttons and its wheel. A pen’s barrel is never one: bind
Pointer.SECONDARYfor both.- LEFT¶
‘DeviceButton(…)’
- RIGHT¶
‘DeviceButton(…)’
- MIDDLE¶
‘DeviceButton(…)’
- BACK¶
‘DeviceButton(…)’
- FORWARD¶
‘DeviceButton(…)’
- WHEEL¶
‘DeviceAxis(…)’
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis¶
- class simvx.core.input.controls.Touch[source]¶
Bases:
simvx.core.input.controls.DeviceControlsA finger’s contact with the glass, and the gestures fingers make together.
A gesture is recognised only while a binding or a handler names it, so a game that names none pays nothing for them. Each axis is motion: a binding reads the frame’s change and rests at zero in a frame without one.
- CONTACT¶
‘DeviceButton(…)’
- LONG_PRESS¶
‘DeviceButton(…)’
- TWO_FINGER_TAP¶
‘DeviceButton(…)’
- PINCH¶
‘DeviceAxis(…)’
- ROTATE¶
‘DeviceAxis(…)’
- PAN_X¶
‘DeviceAxis(…)’
- PAN_Y¶
‘DeviceAxis(…)’
- PAN¶
‘DeviceStick(…)’
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis¶
- class simvx.core.input.controls.Pen[source]¶
Bases:
simvx.core.input.controls.DeviceControlsA pen’s buttons. The eraser is not here: it is a tool (
PointerTool.ERASER), not a button.- TIP¶
‘DeviceButton(…)’
- BARREL_1¶
‘DeviceButton(…)’
- BARREL_2¶
‘DeviceButton(…)’
- BARREL_3¶
‘DeviceButton(…)’
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis¶
- class simvx.core.input.controls.Tablet[source]¶
Bases:
simvx.core.input.controls.DeviceControlsA tablet’s own controls: express keys by index, and the rings and strips a layout names.
The pen on the tablet is :class:
Pen. No express key has a name the engine could promise, so they areTablet.button(i); a backend that knows the device names its rings and strips.- RING¶
‘DeviceAxis(…)’
- RING_2¶
‘DeviceAxis(…)’
- STRIP¶
‘DeviceAxis(…)’
- STRIP_2¶
‘DeviceAxis(…)’
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis¶
- class simvx.core.input.controls.Controller[source]¶
Bases:
simvx.core.input.controls.DeviceControlsA pad’s controls, by position:
Controller.Ais the bottom face button on every pad.What is printed on that button moves with the family (Cross on a PlayStation pad, B on a Nintendo one), and
ControllerDevice.labelsays what; the control does not. A pad no mapping database knows reports the driver’s own indices, which bind asController.button(i)andController.axis(i)until a layout names them.Sticks run -1 to 1 per axis,
+ydown; triggers run 0 released to 1 pulled.- A¶
‘DeviceButton(…)’
- B¶
‘DeviceButton(…)’
- X¶
‘DeviceButton(…)’
- Y¶
‘DeviceButton(…)’
- LEFT_BUMPER¶
‘DeviceButton(…)’
- RIGHT_BUMPER¶
‘DeviceButton(…)’
- BACK¶
‘DeviceButton(…)’
- START¶
‘DeviceButton(…)’
- GUIDE¶
‘DeviceButton(…)’
- LEFT_THUMB¶
‘DeviceButton(…)’
- RIGHT_THUMB¶
‘DeviceButton(…)’
- DPAD_UP¶
‘DeviceButton(…)’
- DPAD_RIGHT¶
‘DeviceButton(…)’
- DPAD_DOWN¶
‘DeviceButton(…)’
- DPAD_LEFT¶
‘DeviceButton(…)’
- LEFT_X¶
‘DeviceAxis(…)’
- LEFT_Y¶
‘DeviceAxis(…)’
- RIGHT_X¶
‘DeviceAxis(…)’
- RIGHT_Y¶
‘DeviceAxis(…)’
- LEFT_TRIGGER¶
‘DeviceAxis(…)’
- RIGHT_TRIGGER¶
‘DeviceAxis(…)’
- LEFT_STICK¶
‘DeviceStick(…)’
- RIGHT_STICK¶
‘DeviceStick(…)’
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- classmethod button(index: int) simvx.core.input.controls.DeviceButton¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis¶
- class simvx.core.input.controls.Pointer[source]¶
Bases:
simvx.core.input.controls.DeviceControlsThe roles every pointer inherits: its main press and its alternate press.
Kept to the two whose meaning genuinely crosses devices. Back, forward and the middle click are the mouse’s own, because nothing else means them.
- PRIMARY¶
‘DeviceButton(…)’
- SECONDARY¶
‘DeviceButton(…)’
- classmethod button(index: int) simvx.core.input.controls.DeviceButton[source]¶
- classmethod axis(index: int) simvx.core.input.controls.DeviceAxis[source]¶
- device: ClassVar[simvx.core.input.controls.DeviceType]¶
None
- classmethod __init_subclass__(*, device: simvx.core.input.controls.DeviceType, **kwargs: Any) None¶
- __new__(*args: object, **kwargs: object) simvx.core.input.controls.DeviceControls¶
- simvx.core.input.controls.MODIFIER_SIDES: collections.abc.Mapping[simvx.core.input.controls.DeviceButton, frozenset[simvx.core.input.controls.DeviceButton]]¶
‘MappingProxyType(…)’
- simvx.core.input.controls.MODIFIER_OF: collections.abc.Mapping[simvx.core.input.controls.DeviceButton, simvx.core.input.controls.DeviceButton]¶
‘MappingProxyType(…)’
- simvx.core.input.controls.ROLE_MEMBER: collections.abc.Mapping[tuple[simvx.core.input.controls.DeviceButton, simvx.core.input.controls.DeviceType], simvx.core.input.controls.DeviceButton]¶
‘MappingProxyType(…)’
- simvx.core.input.controls.roles_of(control: simvx.core.input.controls.DeviceControl) tuple[simvx.core.input.controls.DeviceButton, ...][source]¶
The roles control belongs to:
(Pointer.PRIMARY,)forMouse.LEFT,()for most.
- simvx.core.input.controls.key_code(key: simvx.core.input.controls.DeviceControl) int | None[source]¶
The physical position key is on the engine’s key table, or None for a control that is not a key.
- simvx.core.input.controls.key_for_code(code: int) simvx.core.input.controls.DeviceButton[source]¶
The key at platform code code: the named one where the table has it, else
Key.button(code).
- simvx.core.input.controls.SELF_MODIFIER: dict[int, int]¶
None
- simvx.core.input.controls.key_to_name(key: simvx.core.input.controls.DeviceButton) str[source]¶
The combo spelling of one key:
"space","shift","a".
- simvx.core.input.controls.name_to_keys(name: str) list[simvx.core.input.controls.DeviceButton][source]¶
Every key a combo name can mean:
"shift"is both shifts.