forked from Felk/dolphin
-
Notifications
You must be signed in to change notification settings - Fork 3
/
dolphin_controller.pyi
133 lines (105 loc) · 3.71 KB
/
dolphin_controller.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
"""
Module for programmatic inputs.
Currently, only for GameCube, Wiimote, Nunchuck buttons and Wii IR (pointing).
No acceleration or other extensions data yet.
"""
from typing import TypedDict, type_check_only
@type_check_only
class GCInputs(TypedDict):
Left: bool
Right: bool
Down: bool
Up: bool
Z: bool
R: bool
L: bool
A: bool
B: bool
X: bool
Y: bool
Start: bool
StickX: int # 0-255, 128 is neutral
StickY: int # 0-255, 128 is neutral
CStickX: int # 0-255, 128 is neutral
CStickY: int # 0-255, 128 is neutral
TriggerLeft: int # 0-255
TriggerRight: int # 0-255
AnalogA: int # 0-255
AnalogB: int # 0-255
Connected: bool
@type_check_only
class WiiInputs(TypedDict):
Left: bool
Right: bool
Down: bool
Up: bool
Plus: bool
Minus: bool
One: bool
Two: bool
A: bool
B: bool
Home: bool
class NunchuckInputs(TypedDict):
C: bool
Z: bool
StickX: int # 0-255, 128 is neutral
StickY: int # 0-255, 128 is neutral
def get_gc_buttons(controller_id: int, /) -> GCInputs:
"""
Retrieves the current input map for the given GameCube controller.
:param controller_id: 0-based index of the controller
:return: dictionary describing the current input map
"""
def set_gc_buttons(controller_id: int, inputs: GCInputs, /) -> None:
"""
Sets the current input map for the given GameCube controller.
The override will hold for the current frame.
:param controller_id: 0-based index of the controller
:param inputs: dictionary describing the input map
"""
def get_wii_buttons(controller_id: int, /) -> WiiInputs:
"""
Retrieves the current input map for the given Wii controller.
:param controller_id: 0-based index of the controller
:return: dictionary describing the current input map
"""
def set_wii_buttons(controller_id: int, inputs: WiiInputs, /) -> None:
"""
Sets the current input map for the given Wii controller.
The override will hold for the current frame.
:param controller_id: 0-based index of the controller
:param inputs: dictionary describing the input map
"""
def set_wii_ircamera_transform(
controller_id: int, x: float, y: float,
z: float = -2, pitch: float = 0, yaw: float = 0, roll: float = 0, /,
) -> None:
"""
Places the simulated IR camera at the specified location
with the specified rotation relative to the sensor bar.
For example, to move 2 meters away from the sensor,
15 centimeters to the right and 5 centimeters down, use:
`set_wii_ircamera_transform(controller_id, 0.15, -0.05, -2)`.
:param controller_id: 0-based index of the controller
:param x: x-position of the simulated IR camera in meters
:param y: y-position of the simulated IR camera in meters
:param z: z-position of the simulated IR camera in meters.
Default is -2, meaning 2 meters from the simulated sensor bar.
:param pitch: pitch of the simulated IR camera in radians.
:param yaw: yaw of the simulated IR camera in radians.
:param roll: roll of the simulated IR camera in radians.
"""
def get_nunchuck_buttons(controller_id: int, /) -> NunchuckInputs:
"""
Retrieves the current input map for the given Nunchuck extension.
:param controller_id: 0-based index of the controller
:return: dictionary describing the current input map
"""
def set_nunchuck_buttons(controller_id: int, inputs: NunchuckInputs, /) -> None:
"""
Sets the current input map for the given Nunchuck extension.
The override will hold for the current frame.
:param controller_id: 0-based index of the controller
:param inputs: dictionary describing the input map
"""