@desklink/host 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +44 -0
  3. package/README.md +266 -0
  4. package/bin/desklink-host.mjs +113 -0
  5. package/dist/bridge.d.ts +57 -0
  6. package/dist/bridge.d.ts.map +1 -0
  7. package/dist/bridge.js +208 -0
  8. package/dist/bridge.js.map +1 -0
  9. package/dist/engineProcess.d.ts +82 -0
  10. package/dist/engineProcess.d.ts.map +1 -0
  11. package/dist/engineProcess.js +243 -0
  12. package/dist/engineProcess.js.map +1 -0
  13. package/dist/index.d.ts +12 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +12 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/protocol.d.ts +169 -0
  18. package/dist/protocol.d.ts.map +1 -0
  19. package/dist/protocol.js +18 -0
  20. package/dist/protocol.js.map +1 -0
  21. package/dist/resolveEngine.d.ts +34 -0
  22. package/dist/resolveEngine.d.ts.map +1 -0
  23. package/dist/resolveEngine.js +103 -0
  24. package/dist/resolveEngine.js.map +1 -0
  25. package/docs/BOUNDARY.md +145 -0
  26. package/docs/PROTOCOL.md +363 -0
  27. package/engine/Cargo.lock +3077 -0
  28. package/engine/Cargo.toml +37 -0
  29. package/engine/build.rs +107 -0
  30. package/engine/native/inputtino_shim.cpp +11 -0
  31. package/engine/native/vpx_shim.c +184 -0
  32. package/engine/native/wrapper.h +7 -0
  33. package/engine/src/capture.rs +510 -0
  34. package/engine/src/clipboard.rs +132 -0
  35. package/engine/src/convert.rs +299 -0
  36. package/engine/src/encoder.rs +204 -0
  37. package/engine/src/input.rs +355 -0
  38. package/engine/src/keymap.rs +338 -0
  39. package/engine/src/main.rs +614 -0
  40. package/engine/src/peer.rs +775 -0
  41. package/engine/src/portal.rs +115 -0
  42. package/engine/src/protocol.rs +331 -0
  43. package/engine/src/session.rs +2159 -0
  44. package/engine/src/x11.rs +244 -0
  45. package/engine/vendor/inputtino/.clang-format +166 -0
  46. package/engine/vendor/inputtino/.clang-tidy +30 -0
  47. package/engine/vendor/inputtino/.dockerignore +11 -0
  48. package/engine/vendor/inputtino/.github/workflows/mirror-repo.yml +14 -0
  49. package/engine/vendor/inputtino/.github/workflows/python-lint-format-test-typecheck.yml +124 -0
  50. package/engine/vendor/inputtino/.github/workflows/python-test-install.yaml +49 -0
  51. package/engine/vendor/inputtino/.github/workflows/rust.yml +40 -0
  52. package/engine/vendor/inputtino/CMakeLists.txt +187 -0
  53. package/engine/vendor/inputtino/LICENSE +21 -0
  54. package/engine/vendor/inputtino/README.md +110 -0
  55. package/engine/vendor/inputtino/bindings/python/.devcontainer/Dockerfile +23 -0
  56. package/engine/vendor/inputtino/bindings/python/.devcontainer/devcontainer.json +28 -0
  57. package/engine/vendor/inputtino/bindings/python/.python-version +1 -0
  58. package/engine/vendor/inputtino/bindings/python/CMakeLists.txt +23 -0
  59. package/engine/vendor/inputtino/bindings/python/CPPLINT.cfg +2 -0
  60. package/engine/vendor/inputtino/bindings/python/Makefile +49 -0
  61. package/engine/vendor/inputtino/bindings/python/README.md +215 -0
  62. package/engine/vendor/inputtino/bindings/python/pyproject.toml +178 -0
  63. package/engine/vendor/inputtino/bindings/python/src/inputtino/__init__.py +43 -0
  64. package/engine/vendor/inputtino/bindings/python/src/inputtino/_core.pyi +533 -0
  65. package/engine/vendor/inputtino/bindings/python/src/inputtino/base.py +63 -0
  66. package/engine/vendor/inputtino/bindings/python/src/inputtino/joypad.py +248 -0
  67. package/engine/vendor/inputtino/bindings/python/src/inputtino/keyboard.py +256 -0
  68. package/engine/vendor/inputtino/bindings/python/src/inputtino/mouse.py +106 -0
  69. package/engine/vendor/inputtino/bindings/python/src/inputtino/pentablet.py +73 -0
  70. package/engine/vendor/inputtino/bindings/python/src/inputtino/py.typed +0 -0
  71. package/engine/vendor/inputtino/bindings/python/src/inputtino/touchscreen.py +61 -0
  72. package/engine/vendor/inputtino/bindings/python/src/inputtino/trackpad.py +74 -0
  73. package/engine/vendor/inputtino/bindings/python/src/main.cpp +217 -0
  74. package/engine/vendor/inputtino/bindings/python/tests/__init__.py +0 -0
  75. package/engine/vendor/inputtino/bindings/python/tests/helpers.py +3 -0
  76. package/engine/vendor/inputtino/bindings/python/tests/test_base.py +60 -0
  77. package/engine/vendor/inputtino/bindings/python/tests/test_inputtino.py +5 -0
  78. package/engine/vendor/inputtino/bindings/python/tests/test_joypad.py +332 -0
  79. package/engine/vendor/inputtino/bindings/python/tests/test_keyboard.py +164 -0
  80. package/engine/vendor/inputtino/bindings/python/tests/test_mouse.py +185 -0
  81. package/engine/vendor/inputtino/bindings/python/tests/test_pentablet.py +198 -0
  82. package/engine/vendor/inputtino/bindings/python/tests/test_touchscreen.py +144 -0
  83. package/engine/vendor/inputtino/bindings/python/tests/test_trackpad.py +146 -0
  84. package/engine/vendor/inputtino/bindings/python/uv.lock +390 -0
  85. package/engine/vendor/inputtino/bindings/rust/Cargo.toml +6 -0
  86. package/engine/vendor/inputtino/bindings/rust/inputtino/.dockerignore +1 -0
  87. package/engine/vendor/inputtino/bindings/rust/inputtino/Cargo.toml +18 -0
  88. package/engine/vendor/inputtino/bindings/rust/inputtino/examples/keyboard.rs +33 -0
  89. package/engine/vendor/inputtino/bindings/rust/inputtino/examples/mouse.rs +17 -0
  90. package/engine/vendor/inputtino/bindings/rust/inputtino/src/common.rs +116 -0
  91. package/engine/vendor/inputtino/bindings/rust/inputtino/src/error.rs +17 -0
  92. package/engine/vendor/inputtino/bindings/rust/inputtino/src/joypad.rs +74 -0
  93. package/engine/vendor/inputtino/bindings/rust/inputtino/src/joypad_nintendo.rs +135 -0
  94. package/engine/vendor/inputtino/bindings/rust/inputtino/src/joypad_ps5.rs +280 -0
  95. package/engine/vendor/inputtino/bindings/rust/inputtino/src/joypad_xbox.rs +134 -0
  96. package/engine/vendor/inputtino/bindings/rust/inputtino/src/keyboard.rs +76 -0
  97. package/engine/vendor/inputtino/bindings/rust/inputtino/src/lib.rs +32 -0
  98. package/engine/vendor/inputtino/bindings/rust/inputtino/src/mouse.rs +178 -0
  99. package/engine/vendor/inputtino/bindings/rust/inputtino/tests/common.rs +38 -0
  100. package/engine/vendor/inputtino/bindings/rust/inputtino/tests/joypads.rs +150 -0
  101. package/engine/vendor/inputtino/bindings/rust/inputtino/tests/keyboard.rs +73 -0
  102. package/engine/vendor/inputtino/bindings/rust/inputtino/tests/mouse.rs +139 -0
  103. package/engine/vendor/inputtino/bindings/rust/inputtino-sys/.dockerignore +1 -0
  104. package/engine/vendor/inputtino/bindings/rust/inputtino-sys/Cargo.toml +12 -0
  105. package/engine/vendor/inputtino/bindings/rust/inputtino-sys/build.rs +48 -0
  106. package/engine/vendor/inputtino/bindings/rust/inputtino-sys/src/lib.rs +5 -0
  107. package/engine/vendor/inputtino/bindings/rust/inputtino-sys/wrapper.h +1 -0
  108. package/engine/vendor/inputtino/cmake/utils.cmake +9 -0
  109. package/engine/vendor/inputtino/docker/Dockerfile +70 -0
  110. package/engine/vendor/inputtino/include/inputtino/input.h +324 -0
  111. package/engine/vendor/inputtino/include/inputtino/input.hpp +466 -0
  112. package/engine/vendor/inputtino/include/inputtino/result.hpp +37 -0
  113. package/engine/vendor/inputtino/share/pkgconfig/libinputtino.pc.in +17 -0
  114. package/engine/vendor/inputtino/src/c-bindings/helpers.hpp +19 -0
  115. package/engine/vendor/inputtino/src/c-bindings/joypad_ps5.cpp +115 -0
  116. package/engine/vendor/inputtino/src/c-bindings/joypad_switch.cpp +63 -0
  117. package/engine/vendor/inputtino/src/c-bindings/joypad_xone.cpp +62 -0
  118. package/engine/vendor/inputtino/src/c-bindings/keyboard.cpp +42 -0
  119. package/engine/vendor/inputtino/src/c-bindings/mouse.cpp +67 -0
  120. package/engine/vendor/inputtino/src/c-bindings/pen_tablet.cpp +50 -0
  121. package/engine/vendor/inputtino/src/c-bindings/touchscreen.cpp +43 -0
  122. package/engine/vendor/inputtino/src/c-bindings/trackpad.cpp +49 -0
  123. package/engine/vendor/inputtino/src/uhid/README.adoc +63 -0
  124. package/engine/vendor/inputtino/src/uhid/include/crc32.hpp +38 -0
  125. package/engine/vendor/inputtino/src/uhid/include/uhid/protected_types.hpp +36 -0
  126. package/engine/vendor/inputtino/src/uhid/include/uhid/ps5.hpp +550 -0
  127. package/engine/vendor/inputtino/src/uhid/include/uhid/uhid.hpp +168 -0
  128. package/engine/vendor/inputtino/src/uhid/joypad_ps5.cpp +580 -0
  129. package/engine/vendor/inputtino/src/uinput/include/inputtino/keyboard.hpp +84 -0
  130. package/engine/vendor/inputtino/src/uinput/include/inputtino/protected_ps5_types.hpp +7 -0
  131. package/engine/vendor/inputtino/src/uinput/include/inputtino/protected_types.hpp +110 -0
  132. package/engine/vendor/inputtino/src/uinput/joypad_nintendo.cpp +190 -0
  133. package/engine/vendor/inputtino/src/uinput/joypad_ps.cpp +203 -0
  134. package/engine/vendor/inputtino/src/uinput/joypad_utils.hpp +246 -0
  135. package/engine/vendor/inputtino/src/uinput/joypad_xbox.cpp +190 -0
  136. package/engine/vendor/inputtino/src/uinput/keyboard.cpp +120 -0
  137. package/engine/vendor/inputtino/src/uinput/mouse.cpp +199 -0
  138. package/engine/vendor/inputtino/src/uinput/pentablet.cpp +162 -0
  139. package/engine/vendor/inputtino/src/uinput/touchscreen.cpp +140 -0
  140. package/engine/vendor/inputtino/src/uinput/trackpad.cpp +192 -0
  141. package/examples/reference-client.html +428 -0
  142. package/package.json +38 -0
@@ -0,0 +1,533 @@
1
+ """Pybind inputtino module!"""
2
+
3
+ from __future__ import annotations
4
+
5
+ import typing
6
+
7
+ __all__ = [
8
+ "ControllerButton",
9
+ "DeviceDefinition",
10
+ "Joypad",
11
+ "Keyboard",
12
+ "Mouse",
13
+ "MouseButton",
14
+ "PS5BatteryState",
15
+ "PS5Joypad",
16
+ "PS5MotionType",
17
+ "PenButtonType",
18
+ "PenTablet",
19
+ "PenToolType",
20
+ "StickPosition",
21
+ "SwitchJoypad",
22
+ "TouchScreen",
23
+ "Trackpad",
24
+ "VirtualDevice",
25
+ "XboxOneJoypad",
26
+ ]
27
+
28
+ class ControllerButton:
29
+ """
30
+ Members:
31
+
32
+ DPAD_UP
33
+
34
+ DPAD_DOWN
35
+
36
+ DPAD_LEFT
37
+
38
+ DPAD_RIGHT
39
+
40
+ START
41
+
42
+ BACK
43
+
44
+ HOME
45
+
46
+ LEFT_STICK
47
+
48
+ RIGHT_STICK
49
+
50
+ LEFT_BUTTON
51
+
52
+ RIGHT_BUTTON
53
+
54
+ SPECIAL_FLAG
55
+
56
+ PADDLE1_FLAG
57
+
58
+ PADDLE2_FLAG
59
+
60
+ PADDLE3_FLAG
61
+
62
+ PADDLE4_FLAG
63
+
64
+ TOUCHPAD_FLAG
65
+
66
+ MISC_FLAG
67
+
68
+ A
69
+
70
+ B
71
+
72
+ X
73
+
74
+ Y
75
+ """
76
+
77
+ A: typing.ClassVar[ControllerButton] # value = <ControllerButton.A: 4096>
78
+ B: typing.ClassVar[ControllerButton] # value = <ControllerButton.B: 8192>
79
+ BACK: typing.ClassVar[ControllerButton] # value = <ControllerButton.BACK: 32>
80
+ DPAD_DOWN: typing.ClassVar[
81
+ ControllerButton
82
+ ] # value = <ControllerButton.DPAD_DOWN: 2>
83
+ DPAD_LEFT: typing.ClassVar[
84
+ ControllerButton
85
+ ] # value = <ControllerButton.DPAD_LEFT: 4>
86
+ DPAD_RIGHT: typing.ClassVar[
87
+ ControllerButton
88
+ ] # value = <ControllerButton.DPAD_RIGHT: 8>
89
+ DPAD_UP: typing.ClassVar[ControllerButton] # value = <ControllerButton.DPAD_UP: 1>
90
+ HOME: typing.ClassVar[ControllerButton] # value = <ControllerButton.HOME: 1024>
91
+ LEFT_BUTTON: typing.ClassVar[
92
+ ControllerButton
93
+ ] # value = <ControllerButton.LEFT_BUTTON: 256>
94
+ LEFT_STICK: typing.ClassVar[
95
+ ControllerButton
96
+ ] # value = <ControllerButton.LEFT_STICK: 64>
97
+ MISC_FLAG: typing.ClassVar[
98
+ ControllerButton
99
+ ] # value = <ControllerButton.MISC_FLAG: 2097152>
100
+ PADDLE1_FLAG: typing.ClassVar[
101
+ ControllerButton
102
+ ] # value = <ControllerButton.PADDLE1_FLAG: 65536>
103
+ PADDLE2_FLAG: typing.ClassVar[
104
+ ControllerButton
105
+ ] # value = <ControllerButton.PADDLE2_FLAG: 131072>
106
+ PADDLE3_FLAG: typing.ClassVar[
107
+ ControllerButton
108
+ ] # value = <ControllerButton.PADDLE3_FLAG: 262144>
109
+ PADDLE4_FLAG: typing.ClassVar[
110
+ ControllerButton
111
+ ] # value = <ControllerButton.PADDLE4_FLAG: 524288>
112
+ RIGHT_BUTTON: typing.ClassVar[
113
+ ControllerButton
114
+ ] # value = <ControllerButton.RIGHT_BUTTON: 512>
115
+ RIGHT_STICK: typing.ClassVar[
116
+ ControllerButton
117
+ ] # value = <ControllerButton.RIGHT_STICK: 128>
118
+ SPECIAL_FLAG: typing.ClassVar[
119
+ ControllerButton
120
+ ] # value = <ControllerButton.HOME: 1024>
121
+ START: typing.ClassVar[ControllerButton] # value = <ControllerButton.START: 16>
122
+ TOUCHPAD_FLAG: typing.ClassVar[
123
+ ControllerButton
124
+ ] # value = <ControllerButton.TOUCHPAD_FLAG: 1048576>
125
+ X: typing.ClassVar[ControllerButton] # value = <ControllerButton.X: 16384>
126
+ Y: typing.ClassVar[ControllerButton] # value = <ControllerButton.Y: 32768>
127
+ __members__: typing.ClassVar[
128
+ dict[str, ControllerButton]
129
+ ] # value = {'DPAD_UP': <ControllerButton.DPAD_UP: 1>, 'DPAD_DOWN': <ControllerButton.DPAD_DOWN: 2>, 'DPAD_LEFT': <ControllerButton.DPAD_LEFT: 4>, 'DPAD_RIGHT': <ControllerButton.DPAD_RIGHT: 8>, 'START': <ControllerButton.START: 16>, 'BACK': <ControllerButton.BACK: 32>, 'HOME': <ControllerButton.HOME: 1024>, 'LEFT_STICK': <ControllerButton.LEFT_STICK: 64>, 'RIGHT_STICK': <ControllerButton.RIGHT_STICK: 128>, 'LEFT_BUTTON': <ControllerButton.LEFT_BUTTON: 256>, 'RIGHT_BUTTON': <ControllerButton.RIGHT_BUTTON: 512>, 'SPECIAL_FLAG': <ControllerButton.HOME: 1024>, 'PADDLE1_FLAG': <ControllerButton.PADDLE1_FLAG: 65536>, 'PADDLE2_FLAG': <ControllerButton.PADDLE2_FLAG: 131072>, 'PADDLE3_FLAG': <ControllerButton.PADDLE3_FLAG: 262144>, 'PADDLE4_FLAG': <ControllerButton.PADDLE4_FLAG: 524288>, 'TOUCHPAD_FLAG': <ControllerButton.TOUCHPAD_FLAG: 1048576>, 'MISC_FLAG': <ControllerButton.MISC_FLAG: 2097152>, 'A': <ControllerButton.A: 4096>, 'B': <ControllerButton.B: 8192>, 'X': <ControllerButton.X: 16384>, 'Y': <ControllerButton.Y: 32768>}
130
+ @staticmethod
131
+ def _pybind11_conduit_v1_(
132
+ *args: typing.Any, **kwargs: typing.Any
133
+ ) -> typing.Any: ...
134
+ def __eq__(self, other: typing.Any) -> bool: ...
135
+ def __getstate__(self) -> int: ...
136
+ def __hash__(self) -> int: ...
137
+ def __index__(self) -> int: ...
138
+ def __init__(self, value: int) -> None: ...
139
+ def __int__(self) -> int: ...
140
+ def __ne__(self, other: typing.Any) -> bool: ...
141
+ def __repr__(self) -> str: ...
142
+ def __setstate__(self, state: int) -> None: ...
143
+ def __str__(self) -> str: ...
144
+ @property
145
+ def name(self) -> str: ...
146
+ @property
147
+ def value(self) -> int: ...
148
+
149
+ class DeviceDefinition:
150
+ device_phys: str
151
+ device_uniq: str
152
+ name: str
153
+ product_id: int
154
+ vendor_id: int
155
+ version: int
156
+ @staticmethod
157
+ def _pybind11_conduit_v1_(
158
+ *args: typing.Any, **kwargs: typing.Any
159
+ ) -> typing.Any: ...
160
+ def __init__(self) -> None: ...
161
+
162
+ class Joypad(VirtualDevice):
163
+ @staticmethod
164
+ def _pybind11_conduit_v1_(
165
+ *args: typing.Any, **kwargs: typing.Any
166
+ ) -> typing.Any: ...
167
+ def set_pressed_buttons(self, arg0: int) -> None: ...
168
+ def set_stick(self, arg0: StickPosition, arg1: int, arg2: int) -> None: ...
169
+ def set_triggers(self, arg0: int, arg1: int) -> None: ...
170
+
171
+ class Keyboard(VirtualDevice):
172
+ @staticmethod
173
+ def _pybind11_conduit_v1_(
174
+ *args: typing.Any, **kwargs: typing.Any
175
+ ) -> typing.Any: ...
176
+ @staticmethod
177
+ def create(arg0: DeviceDefinition, arg1: int) -> Keyboard: ...
178
+ def press(self, arg0: int) -> None: ...
179
+ def release(self, arg0: int) -> None: ...
180
+
181
+ class Mouse(VirtualDevice):
182
+ @staticmethod
183
+ def _pybind11_conduit_v1_(
184
+ *args: typing.Any, **kwargs: typing.Any
185
+ ) -> typing.Any: ...
186
+ @staticmethod
187
+ def create(arg0: DeviceDefinition) -> Mouse: ...
188
+ def horizontal_scroll(self, arg0: int) -> None: ...
189
+ def move(self, arg0: int, arg1: int) -> None: ...
190
+ def move_abs(self, arg0: int, arg1: int, arg2: int, arg3: int) -> None: ...
191
+ def press(self, arg0: MouseButton) -> None: ...
192
+ def release(self, arg0: MouseButton) -> None: ...
193
+ def vertical_scroll(self, arg0: int) -> None: ...
194
+
195
+ class MouseButton:
196
+ """
197
+ Members:
198
+
199
+ LEFT
200
+
201
+ MIDDLE
202
+
203
+ RIGHT
204
+
205
+ SIDE
206
+
207
+ EXTRA
208
+ """
209
+
210
+ EXTRA: typing.ClassVar[MouseButton] # value = <MouseButton.EXTRA: 4>
211
+ LEFT: typing.ClassVar[MouseButton] # value = <MouseButton.LEFT: 0>
212
+ MIDDLE: typing.ClassVar[MouseButton] # value = <MouseButton.MIDDLE: 1>
213
+ RIGHT: typing.ClassVar[MouseButton] # value = <MouseButton.RIGHT: 2>
214
+ SIDE: typing.ClassVar[MouseButton] # value = <MouseButton.SIDE: 3>
215
+ __members__: typing.ClassVar[
216
+ dict[str, MouseButton]
217
+ ] # value = {'LEFT': <MouseButton.LEFT: 0>, 'MIDDLE': <MouseButton.MIDDLE: 1>, 'RIGHT': <MouseButton.RIGHT: 2>, 'SIDE': <MouseButton.SIDE: 3>, 'EXTRA': <MouseButton.EXTRA: 4>}
218
+ @staticmethod
219
+ def _pybind11_conduit_v1_(
220
+ *args: typing.Any, **kwargs: typing.Any
221
+ ) -> typing.Any: ...
222
+ def __eq__(self, other: typing.Any) -> bool: ...
223
+ def __getstate__(self) -> int: ...
224
+ def __hash__(self) -> int: ...
225
+ def __index__(self) -> int: ...
226
+ def __init__(self, value: int) -> None: ...
227
+ def __int__(self) -> int: ...
228
+ def __ne__(self, other: typing.Any) -> bool: ...
229
+ def __repr__(self) -> str: ...
230
+ def __setstate__(self, state: int) -> None: ...
231
+ def __str__(self) -> str: ...
232
+ @property
233
+ def name(self) -> str: ...
234
+ @property
235
+ def value(self) -> int: ...
236
+
237
+ class PS5BatteryState:
238
+ """
239
+ Members:
240
+
241
+ BATTERY_DISCHARGING
242
+
243
+ BATTERY_CHARGING
244
+
245
+ BATTERY_FULL
246
+
247
+ VOLTAGE_OR_TEMPERATURE_OUT_OF_RANGE
248
+
249
+ TEMPERATURE_ERROR
250
+
251
+ CHARGING_ERROR
252
+ """
253
+
254
+ BATTERY_CHARGING: typing.ClassVar[
255
+ PS5BatteryState
256
+ ] # value = <PS5BatteryState.BATTERY_CHARGING: 1>
257
+ BATTERY_DISCHARGING: typing.ClassVar[
258
+ PS5BatteryState
259
+ ] # value = <PS5BatteryState.BATTERY_DISCHARGING: 0>
260
+ BATTERY_FULL: typing.ClassVar[
261
+ PS5BatteryState
262
+ ] # value = <PS5BatteryState.BATTERY_FULL: 2>
263
+ CHARGING_ERROR: typing.ClassVar[
264
+ PS5BatteryState
265
+ ] # value = <PS5BatteryState.CHARGING_ERROR: 15>
266
+ TEMPERATURE_ERROR: typing.ClassVar[
267
+ PS5BatteryState
268
+ ] # value = <PS5BatteryState.TEMPERATURE_ERROR: 11>
269
+ VOLTAGE_OR_TEMPERATURE_OUT_OF_RANGE: typing.ClassVar[
270
+ PS5BatteryState
271
+ ] # value = <PS5BatteryState.VOLTAGE_OR_TEMPERATURE_OUT_OF_RANGE: 10>
272
+ __members__: typing.ClassVar[
273
+ dict[str, PS5BatteryState]
274
+ ] # value = {'BATTERY_DISCHARGING': <PS5BatteryState.BATTERY_DISCHARGING: 0>, 'BATTERY_CHARGING': <PS5BatteryState.BATTERY_CHARGING: 1>, 'BATTERY_FULL': <PS5BatteryState.BATTERY_FULL: 2>, 'VOLTAGE_OR_TEMPERATURE_OUT_OF_RANGE': <PS5BatteryState.VOLTAGE_OR_TEMPERATURE_OUT_OF_RANGE: 10>, 'TEMPERATURE_ERROR': <PS5BatteryState.TEMPERATURE_ERROR: 11>, 'CHARGING_ERROR': <PS5BatteryState.CHARGING_ERROR: 15>}
275
+ @staticmethod
276
+ def _pybind11_conduit_v1_(
277
+ *args: typing.Any, **kwargs: typing.Any
278
+ ) -> typing.Any: ...
279
+ def __eq__(self, other: typing.Any) -> bool: ...
280
+ def __getstate__(self) -> int: ...
281
+ def __hash__(self) -> int: ...
282
+ def __index__(self) -> int: ...
283
+ def __init__(self, value: int) -> None: ...
284
+ def __int__(self) -> int: ...
285
+ def __ne__(self, other: typing.Any) -> bool: ...
286
+ def __repr__(self) -> str: ...
287
+ def __setstate__(self, state: int) -> None: ...
288
+ def __str__(self) -> str: ...
289
+ @property
290
+ def name(self) -> str: ...
291
+ @property
292
+ def value(self) -> int: ...
293
+
294
+ class PS5Joypad(Joypad):
295
+ @staticmethod
296
+ def _pybind11_conduit_v1_(
297
+ *args: typing.Any, **kwargs: typing.Any
298
+ ) -> typing.Any: ...
299
+ @staticmethod
300
+ def create(arg0: DeviceDefinition) -> PS5Joypad: ...
301
+ def get_mac_address(self) -> str: ...
302
+ def get_sys_nodes(self) -> list[str]: ...
303
+ def place_finger(self, arg0: int, arg1: int, arg2: int) -> None: ...
304
+ def release_finger(self, arg0: int) -> None: ...
305
+ def set_battery(self, arg0: PS5BatteryState, arg1: int) -> None: ...
306
+ def set_motion(
307
+ self, arg0: PS5MotionType, arg1: float, arg2: float, arg3: float
308
+ ) -> None: ...
309
+ def set_on_led(self, arg0: typing.Callable[[int, int, int], None]) -> None: ...
310
+ def set_on_rumble(self, arg0: typing.Callable[[int, int], None]) -> None: ...
311
+
312
+ class PS5MotionType:
313
+ """
314
+ Members:
315
+
316
+ ACCELERATION
317
+
318
+ GYROSCOPE
319
+ """
320
+
321
+ ACCELERATION: typing.ClassVar[
322
+ PS5MotionType
323
+ ] # value = <PS5MotionType.ACCELERATION: 1>
324
+ GYROSCOPE: typing.ClassVar[PS5MotionType] # value = <PS5MotionType.GYROSCOPE: 2>
325
+ __members__: typing.ClassVar[
326
+ dict[str, PS5MotionType]
327
+ ] # value = {'ACCELERATION': <PS5MotionType.ACCELERATION: 1>, 'GYROSCOPE': <PS5MotionType.GYROSCOPE: 2>}
328
+ @staticmethod
329
+ def _pybind11_conduit_v1_(
330
+ *args: typing.Any, **kwargs: typing.Any
331
+ ) -> typing.Any: ...
332
+ def __eq__(self, other: typing.Any) -> bool: ...
333
+ def __getstate__(self) -> int: ...
334
+ def __hash__(self) -> int: ...
335
+ def __index__(self) -> int: ...
336
+ def __init__(self, value: int) -> None: ...
337
+ def __int__(self) -> int: ...
338
+ def __ne__(self, other: typing.Any) -> bool: ...
339
+ def __repr__(self) -> str: ...
340
+ def __setstate__(self, state: int) -> None: ...
341
+ def __str__(self) -> str: ...
342
+ @property
343
+ def name(self) -> str: ...
344
+ @property
345
+ def value(self) -> int: ...
346
+
347
+ class PenButtonType:
348
+ """
349
+ Members:
350
+
351
+ PRIMARY
352
+
353
+ SECONDARY
354
+
355
+ TERTIARY
356
+ """
357
+
358
+ PRIMARY: typing.ClassVar[PenButtonType] # value = <PenButtonType.PRIMARY: 0>
359
+ SECONDARY: typing.ClassVar[PenButtonType] # value = <PenButtonType.SECONDARY: 1>
360
+ TERTIARY: typing.ClassVar[PenButtonType] # value = <PenButtonType.TERTIARY: 2>
361
+ __members__: typing.ClassVar[
362
+ dict[str, PenButtonType]
363
+ ] # value = {'PRIMARY': <PenButtonType.PRIMARY: 0>, 'SECONDARY': <PenButtonType.SECONDARY: 1>, 'TERTIARY': <PenButtonType.TERTIARY: 2>}
364
+ @staticmethod
365
+ def _pybind11_conduit_v1_(
366
+ *args: typing.Any, **kwargs: typing.Any
367
+ ) -> typing.Any: ...
368
+ def __eq__(self, other: typing.Any) -> bool: ...
369
+ def __getstate__(self) -> int: ...
370
+ def __hash__(self) -> int: ...
371
+ def __index__(self) -> int: ...
372
+ def __init__(self, value: int) -> None: ...
373
+ def __int__(self) -> int: ...
374
+ def __ne__(self, other: typing.Any) -> bool: ...
375
+ def __repr__(self) -> str: ...
376
+ def __setstate__(self, state: int) -> None: ...
377
+ def __str__(self) -> str: ...
378
+ @property
379
+ def name(self) -> str: ...
380
+ @property
381
+ def value(self) -> int: ...
382
+
383
+ class PenTablet(VirtualDevice):
384
+ @staticmethod
385
+ def _pybind11_conduit_v1_(
386
+ *args: typing.Any, **kwargs: typing.Any
387
+ ) -> typing.Any: ...
388
+ @staticmethod
389
+ def create(arg0: DeviceDefinition) -> PenTablet: ...
390
+ def place_tool(
391
+ self,
392
+ arg0: PenToolType,
393
+ arg1: float,
394
+ arg2: float,
395
+ arg3: float,
396
+ arg4: float,
397
+ arg5: float,
398
+ arg6: float,
399
+ ) -> None: ...
400
+ def set_btn(self, arg0: PenButtonType, arg1: bool) -> None: ...
401
+
402
+ class PenToolType:
403
+ """
404
+ Members:
405
+
406
+ PEN
407
+
408
+ ERASER
409
+
410
+ BRUSH
411
+
412
+ PENCIL
413
+
414
+ AIRBRUSH
415
+
416
+ TOUCH
417
+
418
+ SAME_AS_BEFORE
419
+ """
420
+
421
+ AIRBRUSH: typing.ClassVar[PenToolType] # value = <PenToolType.AIRBRUSH: 4>
422
+ BRUSH: typing.ClassVar[PenToolType] # value = <PenToolType.BRUSH: 2>
423
+ ERASER: typing.ClassVar[PenToolType] # value = <PenToolType.ERASER: 1>
424
+ PEN: typing.ClassVar[PenToolType] # value = <PenToolType.PEN: 0>
425
+ PENCIL: typing.ClassVar[PenToolType] # value = <PenToolType.PENCIL: 3>
426
+ SAME_AS_BEFORE: typing.ClassVar[
427
+ PenToolType
428
+ ] # value = <PenToolType.SAME_AS_BEFORE: 6>
429
+ TOUCH: typing.ClassVar[PenToolType] # value = <PenToolType.TOUCH: 5>
430
+ __members__: typing.ClassVar[
431
+ dict[str, PenToolType]
432
+ ] # value = {'PEN': <PenToolType.PEN: 0>, 'ERASER': <PenToolType.ERASER: 1>, 'BRUSH': <PenToolType.BRUSH: 2>, 'PENCIL': <PenToolType.PENCIL: 3>, 'AIRBRUSH': <PenToolType.AIRBRUSH: 4>, 'TOUCH': <PenToolType.TOUCH: 5>, 'SAME_AS_BEFORE': <PenToolType.SAME_AS_BEFORE: 6>}
433
+ @staticmethod
434
+ def _pybind11_conduit_v1_(
435
+ *args: typing.Any, **kwargs: typing.Any
436
+ ) -> typing.Any: ...
437
+ def __eq__(self, other: typing.Any) -> bool: ...
438
+ def __getstate__(self) -> int: ...
439
+ def __hash__(self) -> int: ...
440
+ def __index__(self) -> int: ...
441
+ def __init__(self, value: int) -> None: ...
442
+ def __int__(self) -> int: ...
443
+ def __ne__(self, other: typing.Any) -> bool: ...
444
+ def __repr__(self) -> str: ...
445
+ def __setstate__(self, state: int) -> None: ...
446
+ def __str__(self) -> str: ...
447
+ @property
448
+ def name(self) -> str: ...
449
+ @property
450
+ def value(self) -> int: ...
451
+
452
+ class StickPosition:
453
+ """
454
+ Members:
455
+
456
+ RS
457
+
458
+ LS
459
+ """
460
+
461
+ LS: typing.ClassVar[StickPosition] # value = <StickPosition.LS: 1>
462
+ RS: typing.ClassVar[StickPosition] # value = <StickPosition.RS: 0>
463
+ __members__: typing.ClassVar[
464
+ dict[str, StickPosition]
465
+ ] # value = {'RS': <StickPosition.RS: 0>, 'LS': <StickPosition.LS: 1>}
466
+ @staticmethod
467
+ def _pybind11_conduit_v1_(
468
+ *args: typing.Any, **kwargs: typing.Any
469
+ ) -> typing.Any: ...
470
+ def __eq__(self, other: typing.Any) -> bool: ...
471
+ def __getstate__(self) -> int: ...
472
+ def __hash__(self) -> int: ...
473
+ def __index__(self) -> int: ...
474
+ def __init__(self, value: int) -> None: ...
475
+ def __int__(self) -> int: ...
476
+ def __ne__(self, other: typing.Any) -> bool: ...
477
+ def __repr__(self) -> str: ...
478
+ def __setstate__(self, state: int) -> None: ...
479
+ def __str__(self) -> str: ...
480
+ @property
481
+ def name(self) -> str: ...
482
+ @property
483
+ def value(self) -> int: ...
484
+
485
+ class SwitchJoypad(Joypad):
486
+ @staticmethod
487
+ def _pybind11_conduit_v1_(
488
+ *args: typing.Any, **kwargs: typing.Any
489
+ ) -> typing.Any: ...
490
+ @staticmethod
491
+ def create(arg0: DeviceDefinition) -> SwitchJoypad: ...
492
+ def set_on_rumble(self, arg0: typing.Callable[[int, int], None]) -> None: ...
493
+
494
+ class TouchScreen(VirtualDevice):
495
+ @staticmethod
496
+ def _pybind11_conduit_v1_(
497
+ *args: typing.Any, **kwargs: typing.Any
498
+ ) -> typing.Any: ...
499
+ @staticmethod
500
+ def create(arg0: DeviceDefinition) -> TouchScreen: ...
501
+ def place_finger(
502
+ self, arg0: int, arg1: float, arg2: float, arg3: float, arg4: int
503
+ ) -> None: ...
504
+ def release_finger(self, arg0: int) -> None: ...
505
+
506
+ class Trackpad(VirtualDevice):
507
+ @staticmethod
508
+ def _pybind11_conduit_v1_(
509
+ *args: typing.Any, **kwargs: typing.Any
510
+ ) -> typing.Any: ...
511
+ @staticmethod
512
+ def create(arg0: DeviceDefinition) -> Trackpad: ...
513
+ def place_finger(
514
+ self, arg0: int, arg1: float, arg2: float, arg3: float, arg4: int
515
+ ) -> None: ...
516
+ def release_finger(self, arg0: int) -> None: ...
517
+ def set_left_btn(self, arg0: bool) -> None: ...
518
+
519
+ class VirtualDevice:
520
+ @staticmethod
521
+ def _pybind11_conduit_v1_(
522
+ *args: typing.Any, **kwargs: typing.Any
523
+ ) -> typing.Any: ...
524
+ def get_nodes(self) -> list[str]: ...
525
+
526
+ class XboxOneJoypad(Joypad):
527
+ @staticmethod
528
+ def _pybind11_conduit_v1_(
529
+ *args: typing.Any, **kwargs: typing.Any
530
+ ) -> typing.Any: ...
531
+ @staticmethod
532
+ def create(arg0: DeviceDefinition) -> XboxOneJoypad: ...
533
+ def set_on_rumble(self, arg0: typing.Callable[[int, int], None]) -> None: ...
@@ -0,0 +1,63 @@
1
+ from dataclasses import dataclass
2
+
3
+ from . import _core
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class DeviceDefinition:
8
+ """A class representing a virtual device definition.
9
+
10
+ This class wraps the C++ DeviceDefinition class and provides a more Pythonic interface.
11
+
12
+ Args:
13
+ name: Device name
14
+ vendor_id: Vendor ID for the device
15
+ product_id: Product ID for the
16
+ device
17
+ version: Device version
18
+ device_phys: Optional physical device path
19
+ device_uniq: Optional unique device identifier
20
+ """
21
+
22
+ name: str
23
+ vendor_id: int
24
+ product_id: int
25
+ version: int
26
+ device_phys: str = ""
27
+ device_uniq: str = ""
28
+
29
+ def to_core(self) -> _core.DeviceDefinition:
30
+ """Convert to C++ DeviceDefinition object.
31
+
32
+ Returns:
33
+ A C++ DeviceDefinition object used by the core library
34
+ """
35
+ definition = _core.DeviceDefinition()
36
+ definition.name = self.name
37
+ definition.vendor_id = self.vendor_id
38
+ definition.product_id = self.product_id
39
+ definition.version = self.version
40
+ definition.device_phys = self.device_phys
41
+ definition.device_uniq = self.device_uniq
42
+ return definition
43
+
44
+
45
+ class VirtualDevice:
46
+ """Base class for all virtual input devices."""
47
+
48
+ def __init__(self, device: _core.VirtualDevice) -> None:
49
+ """Initialize virtual device.
50
+
51
+ Args:
52
+ device: Core virtual device instance
53
+ """
54
+ self._device = device
55
+
56
+ @property
57
+ def nodes(self) -> list[str]:
58
+ """Get the device nodes created by this virtual device.
59
+
60
+ Returns:
61
+ List of device node paths representing the virtual device in /dev/input/
62
+ """
63
+ return self._device.get_nodes()