@illgrenoble/webx-client 1.8.0 → 1.9.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 (293) hide show
  1. package/README.md +1 -1
  2. package/dist/WebXClient.d.ts +0 -1
  3. package/dist/WebXClient.js +8 -3
  4. package/dist/WebXClient.js.map +1 -1
  5. package/dist/WebXEngine.d.ts +4 -0
  6. package/dist/WebXEngine.js +7 -0
  7. package/dist/WebXEngine.js.map +1 -0
  8. package/dist/display/WebXCursor.d.ts +1 -0
  9. package/dist/display/WebXCursor.js +9 -0
  10. package/dist/display/WebXCursor.js.map +1 -1
  11. package/dist/display/WebXDisplay.d.ts +18 -0
  12. package/dist/display/WebXDisplay.js +47 -4
  13. package/dist/display/WebXDisplay.js.map +1 -1
  14. package/dist/display/WebXMaterial.d.ts +14 -0
  15. package/dist/display/WebXMaterial.js +140 -0
  16. package/dist/display/WebXMaterial.js.map +1 -0
  17. package/dist/display/WebXMaterialProvider.d.ts +8 -0
  18. package/dist/display/WebXMaterialProvider.js +71 -0
  19. package/dist/display/WebXMaterialProvider.js.map +1 -0
  20. package/dist/display/WebXTextureFactory.d.ts +10 -0
  21. package/dist/display/WebXTextureFactory.js +21 -0
  22. package/dist/display/WebXTextureFactory.js.map +1 -1
  23. package/dist/display/WebXWindow.d.ts +32 -0
  24. package/dist/display/WebXWindow.js +84 -6
  25. package/dist/display/WebXWindow.js.map +1 -1
  26. package/dist/display/WebXWindowProperties.d.ts +5 -0
  27. package/dist/display/WebXWindowProperties.js +1 -0
  28. package/dist/display/WebXWindowProperties.js.map +1 -1
  29. package/dist/input/GuacamoleKeyboard.js +1532 -0
  30. package/dist/input/WebXKeyboard.d.ts +10 -232
  31. package/dist/input/WebXKeyboard.js +31 -594
  32. package/dist/input/WebXKeyboard.js.map +1 -1
  33. package/dist/input/WebXNewKeyboard.d.ts +62 -0
  34. package/dist/input/WebXNewKeyboard.js +94 -0
  35. package/dist/input/WebXNewKeyboard.js.map +1 -0
  36. package/dist/input/index.d.ts +0 -1
  37. package/dist/input/index.js +0 -1
  38. package/dist/input/index.js.map +1 -1
  39. package/dist/input/keyboard/WebXKeyboardUtils.js +1 -2
  40. package/dist/input/keyboard/WebXKeyboardUtils.js.map +1 -1
  41. package/dist/instruction/WebXInstructionType.d.ts +5 -1
  42. package/dist/instruction/WebXInstructionType.js +6 -0
  43. package/dist/instruction/WebXInstructionType.js.map +1 -1
  44. package/dist/instruction/WebXShapeInstruction.d.ts +18 -0
  45. package/dist/instruction/WebXShapeInstruction.js +23 -0
  46. package/dist/instruction/WebXShapeInstruction.js.map +1 -0
  47. package/dist/instruction/index.d.ts +1 -0
  48. package/dist/instruction/index.js +1 -0
  49. package/dist/instruction/index.js.map +1 -1
  50. package/dist/lib/GuacamoleKeyboard.js +1290 -0
  51. package/dist/lib/GuacamoleKeyboard.js.map +1 -0
  52. package/dist/message/WebXMessageType.d.ts +5 -1
  53. package/dist/message/WebXMessageType.js +4 -0
  54. package/dist/message/WebXMessageType.js.map +1 -1
  55. package/dist/message/WebXShapeMessage.d.ts +31 -0
  56. package/dist/message/WebXShapeMessage.js +29 -0
  57. package/dist/message/WebXShapeMessage.js.map +1 -0
  58. package/dist/message/index.d.ts +1 -0
  59. package/dist/message/index.js +1 -0
  60. package/dist/message/index.js.map +1 -1
  61. package/dist/src/WebXClient.d.ts +261 -0
  62. package/dist/src/WebXClient.js +571 -0
  63. package/dist/src/WebXClient.js.map +1 -0
  64. package/dist/src/WebXEngine.d.ts +4 -0
  65. package/dist/src/WebXEngine.js +7 -0
  66. package/dist/src/WebXEngine.js.map +1 -0
  67. package/dist/src/display/WebXCursor.d.ts +88 -0
  68. package/dist/src/display/WebXCursor.js +150 -0
  69. package/dist/src/display/WebXCursor.js.map +1 -0
  70. package/dist/src/display/WebXCursorFactory.d.ts +36 -0
  71. package/dist/src/display/WebXCursorFactory.js +59 -0
  72. package/dist/src/display/WebXCursorFactory.js.map +1 -0
  73. package/dist/src/display/WebXDisplay.d.ts +226 -0
  74. package/dist/src/display/WebXDisplay.js +424 -0
  75. package/dist/src/display/WebXDisplay.js.map +1 -0
  76. package/dist/src/display/WebXMaterial.d.ts +14 -0
  77. package/dist/src/display/WebXMaterial.js +140 -0
  78. package/dist/src/display/WebXMaterial.js.map +1 -0
  79. package/dist/src/display/WebXSubImage.d.ts +50 -0
  80. package/dist/src/display/WebXSubImage.js +26 -0
  81. package/dist/src/display/WebXSubImage.js.map +1 -0
  82. package/dist/src/display/WebXTextureFactory.d.ts +54 -0
  83. package/dist/src/display/WebXTextureFactory.js +160 -0
  84. package/dist/src/display/WebXTextureFactory.js.map +1 -0
  85. package/dist/src/display/WebXWindow.d.ts +241 -0
  86. package/dist/src/display/WebXWindow.js +438 -0
  87. package/dist/src/display/WebXWindow.js.map +1 -0
  88. package/dist/src/display/WebXWindowProperties.d.ts +44 -0
  89. package/dist/src/display/WebXWindowProperties.js +25 -0
  90. package/dist/src/display/WebXWindowProperties.js.map +1 -0
  91. package/dist/src/display/index.d.ts +7 -0
  92. package/dist/src/display/index.js +24 -0
  93. package/dist/src/display/index.js.map +1 -0
  94. package/dist/src/index.d.ts +7 -0
  95. package/dist/src/index.js +24 -0
  96. package/dist/src/index.js.map +1 -0
  97. package/dist/src/input/WebXKeyboard.d.ts +265 -0
  98. package/dist/src/input/WebXKeyboard.js +632 -0
  99. package/dist/src/input/WebXKeyboard.js.map +1 -0
  100. package/dist/src/input/WebXMouse.d.ts +125 -0
  101. package/dist/src/input/WebXMouse.js +231 -0
  102. package/dist/src/input/WebXMouse.js.map +1 -0
  103. package/dist/src/input/index.d.ts +4 -0
  104. package/dist/src/input/index.js +21 -0
  105. package/dist/src/input/index.js.map +1 -0
  106. package/dist/src/input/keyboard/WebXKeyEvent.d.ts +79 -0
  107. package/dist/src/input/keyboard/WebXKeyEvent.js +324 -0
  108. package/dist/src/input/keyboard/WebXKeyEvent.js.map +1 -0
  109. package/dist/src/input/keyboard/WebXKeyPressEvent.d.ts +30 -0
  110. package/dist/src/input/keyboard/WebXKeyPressEvent.js +44 -0
  111. package/dist/src/input/keyboard/WebXKeyPressEvent.js.map +1 -0
  112. package/dist/src/input/keyboard/WebXKeyUpEvent.d.ts +33 -0
  113. package/dist/src/input/keyboard/WebXKeyUpEvent.js +31 -0
  114. package/dist/src/input/keyboard/WebXKeyUpEvent.js.map +1 -0
  115. package/dist/src/input/keyboard/WebXKeyboardModifierState.d.ts +108 -0
  116. package/dist/src/input/keyboard/WebXKeyboardModifierState.js +148 -0
  117. package/dist/src/input/keyboard/WebXKeyboardModifierState.js.map +1 -0
  118. package/dist/src/input/keyboard/WebXKeyboardUtils.d.ts +25 -0
  119. package/dist/src/input/keyboard/WebXKeyboardUtils.js +63 -0
  120. package/dist/src/input/keyboard/WebXKeyboardUtils.js.map +1 -0
  121. package/dist/src/input/keyboard/WebXKeydownEvent.d.ts +46 -0
  122. package/dist/src/input/keyboard/WebXKeydownEvent.js +66 -0
  123. package/dist/src/input/keyboard/WebXKeydownEvent.js.map +1 -0
  124. package/dist/src/input/keyboard/index.d.ts +6 -0
  125. package/dist/src/input/keyboard/index.js +23 -0
  126. package/dist/src/input/keyboard/index.js.map +1 -0
  127. package/dist/src/input/mouse/WebXMouseState.d.ts +190 -0
  128. package/dist/src/input/mouse/WebXMouseState.js +217 -0
  129. package/dist/src/input/mouse/WebXMouseState.js.map +1 -0
  130. package/dist/src/input/mouse/index.d.ts +1 -0
  131. package/dist/src/input/mouse/index.js +18 -0
  132. package/dist/src/input/mouse/index.js.map +1 -0
  133. package/dist/src/instruction/WebXClipboardInstruction.d.ts +18 -0
  134. package/dist/src/instruction/WebXClipboardInstruction.js +23 -0
  135. package/dist/src/instruction/WebXClipboardInstruction.js.map +1 -0
  136. package/dist/src/instruction/WebXConnectInstruction.d.ts +19 -0
  137. package/dist/src/instruction/WebXConnectInstruction.js +24 -0
  138. package/dist/src/instruction/WebXConnectInstruction.js.map +1 -0
  139. package/dist/src/instruction/WebXCursorImageInstruction.d.ts +18 -0
  140. package/dist/src/instruction/WebXCursorImageInstruction.js +23 -0
  141. package/dist/src/instruction/WebXCursorImageInstruction.js.map +1 -0
  142. package/dist/src/instruction/WebXDataAckInstruction.d.ts +25 -0
  143. package/dist/src/instruction/WebXDataAckInstruction.js +26 -0
  144. package/dist/src/instruction/WebXDataAckInstruction.js.map +1 -0
  145. package/dist/src/instruction/WebXImageInstruction.d.ts +18 -0
  146. package/dist/src/instruction/WebXImageInstruction.js +23 -0
  147. package/dist/src/instruction/WebXImageInstruction.js.map +1 -0
  148. package/dist/src/instruction/WebXInstruction.d.ts +29 -0
  149. package/dist/src/instruction/WebXInstruction.js +28 -0
  150. package/dist/src/instruction/WebXInstruction.js.map +1 -0
  151. package/dist/src/instruction/WebXInstructionResponse.d.ts +66 -0
  152. package/dist/src/instruction/WebXInstructionResponse.js +78 -0
  153. package/dist/src/instruction/WebXInstructionResponse.js.map +1 -0
  154. package/dist/src/instruction/WebXInstructionType.d.ts +63 -0
  155. package/dist/src/instruction/WebXInstructionType.js +96 -0
  156. package/dist/src/instruction/WebXInstructionType.js.map +1 -0
  157. package/dist/src/instruction/WebXKeyboardInstruction.d.ts +23 -0
  158. package/dist/src/instruction/WebXKeyboardInstruction.js +25 -0
  159. package/dist/src/instruction/WebXKeyboardInstruction.js.map +1 -0
  160. package/dist/src/instruction/WebXMouseInstruction.d.ts +28 -0
  161. package/dist/src/instruction/WebXMouseInstruction.js +27 -0
  162. package/dist/src/instruction/WebXMouseInstruction.js.map +1 -0
  163. package/dist/src/instruction/WebXPongInstruction.d.ts +18 -0
  164. package/dist/src/instruction/WebXPongInstruction.js +23 -0
  165. package/dist/src/instruction/WebXPongInstruction.js.map +1 -0
  166. package/dist/src/instruction/WebXQualityInstruction.d.ts +19 -0
  167. package/dist/src/instruction/WebXQualityInstruction.js +24 -0
  168. package/dist/src/instruction/WebXQualityInstruction.js.map +1 -0
  169. package/dist/src/instruction/WebXScreenInstruction.d.ts +12 -0
  170. package/dist/src/instruction/WebXScreenInstruction.js +20 -0
  171. package/dist/src/instruction/WebXScreenInstruction.js.map +1 -0
  172. package/dist/src/instruction/WebXShapeInstruction.d.ts +18 -0
  173. package/dist/src/instruction/WebXShapeInstruction.js +23 -0
  174. package/dist/src/instruction/WebXShapeInstruction.js.map +1 -0
  175. package/dist/src/instruction/WebXWindowsInstruction.d.ts +13 -0
  176. package/dist/src/instruction/WebXWindowsInstruction.js +21 -0
  177. package/dist/src/instruction/WebXWindowsInstruction.js.map +1 -0
  178. package/dist/src/instruction/index.d.ts +15 -0
  179. package/dist/src/instruction/index.js +32 -0
  180. package/dist/src/instruction/index.js.map +1 -0
  181. package/dist/src/message/WebXClipboardMessage.d.ts +19 -0
  182. package/dist/src/message/WebXClipboardMessage.js +23 -0
  183. package/dist/src/message/WebXClipboardMessage.js.map +1 -0
  184. package/dist/src/message/WebXConnectionMessage.d.ts +12 -0
  185. package/dist/src/message/WebXConnectionMessage.js +20 -0
  186. package/dist/src/message/WebXConnectionMessage.js.map +1 -0
  187. package/dist/src/message/WebXCursorImageMessage.d.ts +46 -0
  188. package/dist/src/message/WebXCursorImageMessage.js +35 -0
  189. package/dist/src/message/WebXCursorImageMessage.js.map +1 -0
  190. package/dist/src/message/WebXImageMessage.d.ts +41 -0
  191. package/dist/src/message/WebXImageMessage.js +33 -0
  192. package/dist/src/message/WebXImageMessage.js.map +1 -0
  193. package/dist/src/message/WebXMessage.d.ts +24 -0
  194. package/dist/src/message/WebXMessage.js +23 -0
  195. package/dist/src/message/WebXMessage.js.map +1 -0
  196. package/dist/src/message/WebXMessageType.d.ts +59 -0
  197. package/dist/src/message/WebXMessageType.js +64 -0
  198. package/dist/src/message/WebXMessageType.js.map +1 -0
  199. package/dist/src/message/WebXMouseMessage.d.ts +30 -0
  200. package/dist/src/message/WebXMouseMessage.js +29 -0
  201. package/dist/src/message/WebXMouseMessage.js.map +1 -0
  202. package/dist/src/message/WebXNopMessage.d.ts +10 -0
  203. package/dist/src/message/WebXNopMessage.js +18 -0
  204. package/dist/src/message/WebXNopMessage.js.map +1 -0
  205. package/dist/src/message/WebXPingMessage.d.ts +13 -0
  206. package/dist/src/message/WebXPingMessage.js +21 -0
  207. package/dist/src/message/WebXPingMessage.js.map +1 -0
  208. package/dist/src/message/WebXQualityMessage.d.ts +39 -0
  209. package/dist/src/message/WebXQualityMessage.js +32 -0
  210. package/dist/src/message/WebXQualityMessage.js.map +1 -0
  211. package/dist/src/message/WebXScreenMessage.d.ts +37 -0
  212. package/dist/src/message/WebXScreenMessage.js +29 -0
  213. package/dist/src/message/WebXScreenMessage.js.map +1 -0
  214. package/dist/src/message/WebXShapeMessage.d.ts +31 -0
  215. package/dist/src/message/WebXShapeMessage.js +29 -0
  216. package/dist/src/message/WebXShapeMessage.js.map +1 -0
  217. package/dist/src/message/WebXSubImagesMessage.d.ts +31 -0
  218. package/dist/src/message/WebXSubImagesMessage.js +29 -0
  219. package/dist/src/message/WebXSubImagesMessage.js.map +1 -0
  220. package/dist/src/message/WebXWindowsMessage.d.ts +21 -0
  221. package/dist/src/message/WebXWindowsMessage.js +25 -0
  222. package/dist/src/message/WebXWindowsMessage.js.map +1 -0
  223. package/dist/src/message/index.d.ts +14 -0
  224. package/dist/src/message/index.js +31 -0
  225. package/dist/src/message/index.js.map +1 -0
  226. package/dist/src/tracer/WebXDebugImageMessageHandler.d.ts +48 -0
  227. package/dist/src/tracer/WebXDebugImageMessageHandler.js +102 -0
  228. package/dist/src/tracer/WebXDebugImageMessageHandler.js.map +1 -0
  229. package/dist/src/tracer/WebXHandler.d.ts +14 -0
  230. package/dist/src/tracer/WebXHandler.js +3 -0
  231. package/dist/src/tracer/WebXHandler.js.map +1 -0
  232. package/dist/src/tracer/WebXInstructionHandler.d.ts +21 -0
  233. package/dist/src/tracer/WebXInstructionHandler.js +13 -0
  234. package/dist/src/tracer/WebXInstructionHandler.js.map +1 -0
  235. package/dist/src/tracer/WebXMessageHandler.d.ts +21 -0
  236. package/dist/src/tracer/WebXMessageHandler.js +13 -0
  237. package/dist/src/tracer/WebXMessageHandler.js.map +1 -0
  238. package/dist/src/tracer/WebXStatsHandler.d.ts +23 -0
  239. package/dist/src/tracer/WebXStatsHandler.js +13 -0
  240. package/dist/src/tracer/WebXStatsHandler.js.map +1 -0
  241. package/dist/src/tracer/index.d.ts +5 -0
  242. package/dist/src/tracer/index.js +22 -0
  243. package/dist/src/tracer/index.js.map +1 -0
  244. package/dist/src/transport/WebXBinarySerializer.d.ts +31 -0
  245. package/dist/src/transport/WebXBinarySerializer.js +63 -0
  246. package/dist/src/transport/WebXBinarySerializer.js.map +1 -0
  247. package/dist/src/transport/WebXInstructionBuffer.d.ts +55 -0
  248. package/dist/src/transport/WebXInstructionBuffer.js +109 -0
  249. package/dist/src/transport/WebXInstructionBuffer.js.map +1 -0
  250. package/dist/src/transport/WebXInstructionEncoder.d.ts +181 -0
  251. package/dist/src/transport/WebXInstructionEncoder.js +294 -0
  252. package/dist/src/transport/WebXInstructionEncoder.js.map +1 -0
  253. package/dist/src/transport/WebXMessageBuffer.d.ts +80 -0
  254. package/dist/src/transport/WebXMessageBuffer.js +104 -0
  255. package/dist/src/transport/WebXMessageBuffer.js.map +1 -0
  256. package/dist/src/transport/WebXMessageDecoder.d.ts +108 -0
  257. package/dist/src/transport/WebXMessageDecoder.js +332 -0
  258. package/dist/src/transport/WebXMessageDecoder.js.map +1 -0
  259. package/dist/src/transport/index.d.ts +5 -0
  260. package/dist/src/transport/index.js +22 -0
  261. package/dist/src/transport/index.js.map +1 -0
  262. package/dist/src/tunnel/WebXTunnel.d.ts +93 -0
  263. package/dist/src/tunnel/WebXTunnel.js +156 -0
  264. package/dist/src/tunnel/WebXTunnel.js.map +1 -0
  265. package/dist/src/tunnel/WebXWebSocketTunnel.d.ts +40 -0
  266. package/dist/src/tunnel/WebXWebSocketTunnel.js +88 -0
  267. package/dist/src/tunnel/WebXWebSocketTunnel.js.map +1 -0
  268. package/dist/src/tunnel/index.d.ts +2 -0
  269. package/dist/src/tunnel/index.js +19 -0
  270. package/dist/src/tunnel/index.js.map +1 -0
  271. package/dist/src/utils/WebXColorGenerator.d.ts +24 -0
  272. package/dist/src/utils/WebXColorGenerator.js +46 -0
  273. package/dist/src/utils/WebXColorGenerator.js.map +1 -0
  274. package/dist/src/utils/WebXVersion.d.ts +34 -0
  275. package/dist/src/utils/WebXVersion.js +25 -0
  276. package/dist/src/utils/WebXVersion.js.map +1 -0
  277. package/dist/src/utils/index.d.ts +2 -0
  278. package/dist/src/utils/index.js +19 -0
  279. package/dist/src/utils/index.js.map +1 -0
  280. package/dist/tracer/WebXDebugImageMessageHandler.js +1 -0
  281. package/dist/tracer/WebXDebugImageMessageHandler.js.map +1 -1
  282. package/dist/transport/WebXInstructionEncoder.d.ts +14 -0
  283. package/dist/transport/WebXInstructionEncoder.js +23 -0
  284. package/dist/transport/WebXInstructionEncoder.js.map +1 -1
  285. package/dist/transport/WebXMessageDecoder.d.ts +7 -0
  286. package/dist/transport/WebXMessageDecoder.js +34 -3
  287. package/dist/transport/WebXMessageDecoder.js.map +1 -1
  288. package/dist/tunnel/WebXWebSocketTunnel.js +12 -0
  289. package/dist/tunnel/WebXWebSocketTunnel.js.map +1 -1
  290. package/dist/utils/WebXVersion.d.ts +4 -0
  291. package/dist/utils/WebXVersion.js +1 -0
  292. package/dist/utils/WebXVersion.js.map +1 -1
  293. package/package.json +5 -3
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXKeyboardModifierState = void 0;
4
+ /**
5
+ * Represents the state of keyboard modifiers (e.g., Shift, Ctrl, Alt).
6
+ *
7
+ * This class tracks the state of each modifier key and provides methods
8
+ * to update and retrieve the state.
9
+ */
10
+ class WebXKeyboardModifierState {
11
+ /**
12
+ * Gets whether the Shift key is pressed.
13
+ *
14
+ * @returns True if the Shift key is pressed, false otherwise.
15
+ */
16
+ get shift() {
17
+ return this._shift;
18
+ }
19
+ /**
20
+ * Sets whether the Shift key is pressed.
21
+ *
22
+ * @param value True to indicate the Shift key is pressed, false otherwise.
23
+ */
24
+ set shift(value) {
25
+ this._shift = value;
26
+ }
27
+ /**
28
+ * Gets whether the Ctrl key is pressed.
29
+ *
30
+ * @returns True if the Ctrl key is pressed, false otherwise.
31
+ */
32
+ get ctrl() {
33
+ return this._ctrl;
34
+ }
35
+ /**
36
+ * Sets whether the Ctrl key is pressed.
37
+ *
38
+ * @param value True to indicate the Ctrl key is pressed, false otherwise.
39
+ */
40
+ set ctrl(value) {
41
+ this._ctrl = value;
42
+ }
43
+ /**
44
+ * Gets whether the Alt key is pressed.
45
+ *
46
+ * @returns True if the Alt key is pressed, false otherwise.
47
+ */
48
+ get alt() {
49
+ return this._alt;
50
+ }
51
+ /**
52
+ * Sets whether the Alt key is pressed.
53
+ *
54
+ * @param value True to indicate the Alt key is pressed, false otherwise.
55
+ */
56
+ set alt(value) {
57
+ this._alt = value;
58
+ }
59
+ /**
60
+ * Gets whether the Meta key (e.g., Command on macOS) is pressed.
61
+ *
62
+ * @returns True if the Meta key is pressed, false otherwise.
63
+ */
64
+ get meta() {
65
+ return this._meta;
66
+ }
67
+ /**
68
+ * Sets whether the Meta key (e.g., Command on macOS) is pressed.
69
+ *
70
+ * @param value True to indicate the Meta key is pressed, false otherwise.
71
+ */
72
+ set meta(value) {
73
+ this._meta = value;
74
+ }
75
+ /**
76
+ * Gets whether the Hyper key is pressed.
77
+ *
78
+ * @returns True if the Hyper key is pressed, false otherwise.
79
+ */
80
+ get hyper() {
81
+ return this._hyper;
82
+ }
83
+ /**
84
+ * Sets whether the Hyper key is pressed.
85
+ *
86
+ * @param value True to indicate the Hyper key is pressed, false otherwise.
87
+ */
88
+ set hyper(value) {
89
+ this._hyper = value;
90
+ }
91
+ /**
92
+ * Creates a new instance of WebXKeyboardModifierState.
93
+ *
94
+ * @param state Optional initial state of the keyboard modifiers.
95
+ * Contains the state of Shift, Ctrl, Alt, Meta, and Hyper keys.
96
+ */
97
+ constructor(state) {
98
+ /**
99
+ * Whether the Shift key is pressed.
100
+ */
101
+ this._shift = false;
102
+ /**
103
+ * Whether the Ctrl key is pressed.
104
+ */
105
+ this._ctrl = false;
106
+ /**
107
+ * Whether the Alt key is pressed.
108
+ */
109
+ this._alt = false;
110
+ /**
111
+ * Whether the Meta key (e.g., Command on macOS) is pressed.
112
+ */
113
+ this._meta = false;
114
+ /**
115
+ * Whether the Hyper key is pressed.
116
+ */
117
+ this._hyper = false;
118
+ if (state) {
119
+ const { shift, ctrl, alt, meta, hyper } = state;
120
+ this._shift = shift;
121
+ this._ctrl = ctrl;
122
+ this._alt = alt;
123
+ this._meta = meta;
124
+ this._hyper = hyper;
125
+ }
126
+ }
127
+ /**
128
+ * Updates the modifier state based on a keyboard event.
129
+ *
130
+ * @param event The keyboard event to process.
131
+ * @returns The updated modifier state.
132
+ */
133
+ fromKeyboardEvent(event) {
134
+ this._shift = event.shiftKey;
135
+ this._ctrl = event.ctrlKey;
136
+ this._alt = event.altKey;
137
+ this._meta = event.metaKey;
138
+ if (event.getModifierState) {
139
+ this.hyper = event.getModifierState('OS')
140
+ || event.getModifierState('Super')
141
+ || event.getModifierState('Hyper')
142
+ || event.getModifierState('Win');
143
+ }
144
+ return this;
145
+ }
146
+ }
147
+ exports.WebXKeyboardModifierState = WebXKeyboardModifierState;
148
+ //# sourceMappingURL=WebXKeyboardModifierState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXKeyboardModifierState.js","sourceRoot":"","sources":["../../../../src/input/keyboard/WebXKeyboardModifierState.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,yBAAyB;IA0BpC;;;;OAIG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAc;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI,CAAC,KAAc;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,IAAW,GAAG,CAAC,KAAc;QAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI,CAAC,KAAc;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAc;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,YAAY,KAAsF;QAzHlG;;WAEG;QACK,WAAM,GAAY,KAAK,CAAC;QAEhC;;WAEG;QACK,UAAK,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACK,SAAI,GAAY,KAAK,CAAC;QAE9B;;WAEG;QACK,UAAK,GAAY,KAAK,CAAC;QAE/B;;WAEG;QACK,WAAM,GAAY,KAAK,CAAC;QAmG9B,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;YAChD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,KAAoB;QAC3C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;QAE3B,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC;mBACpC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC;mBAC/B,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC;mBAC/B,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1JD,8DA0JC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Utility class for keyboard-related operations.
3
+ *
4
+ * This class provides methods to map characters to keysyms and determine
5
+ * whether a key is repeatable.
6
+ */
7
+ export declare class WebXKeyboardUtils {
8
+ /**
9
+ * Maps a Unicode character code to its corresponding X11 keysym.
10
+ *
11
+ * @param codepoint The Unicode character code.
12
+ * @returns The corresponding X11 keysym.
13
+ */
14
+ static keysymFromCharCode(codepoint: number): number;
15
+ static NON_REPEATABLE_KEYS: Array<number>;
16
+ /**
17
+ * Determines whether a key is repeatable.
18
+ *
19
+ * Modifier keys (e.g., Shift, Ctrl, Alt) are not repeatable.
20
+ *
21
+ * @param keysym The keysym of the key to check.
22
+ * @returns True if the key is repeatable, false otherwise.
23
+ */
24
+ static isKeyRepeatable(keySymbol: number): boolean;
25
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXKeyboardUtils = void 0;
4
+ /**
5
+ * Utility class for keyboard-related operations.
6
+ *
7
+ * This class provides methods to map characters to keysyms and determine
8
+ * whether a key is repeatable.
9
+ */
10
+ class WebXKeyboardUtils {
11
+ /**
12
+ * Maps a Unicode character code to its corresponding X11 keysym.
13
+ *
14
+ * @param codepoint The Unicode character code.
15
+ * @returns The corresponding X11 keysym.
16
+ */
17
+ static keysymFromCharCode(codepoint) {
18
+ const isControlCharacter = (char) => {
19
+ return char <= 0x1f || (char >= 0x7f && char <= 0x9f);
20
+ };
21
+ // Keysyms for control characters
22
+ if (isControlCharacter(codepoint)) {
23
+ return 0xff00 | codepoint;
24
+ }
25
+ // Keysyms for ASCII chars
26
+ if (codepoint >= 0x0000 && codepoint <= 0x00ff) {
27
+ return codepoint;
28
+ }
29
+ // Keysyms for Unicode
30
+ if (codepoint >= 0x0100 && codepoint <= 0x10ffff) {
31
+ // return 0x01000000 | codepoint;
32
+ return codepoint;
33
+ }
34
+ return null;
35
+ }
36
+ /**
37
+ * Determines whether a key is repeatable.
38
+ *
39
+ * Modifier keys (e.g., Shift, Ctrl, Alt) are not repeatable.
40
+ *
41
+ * @param keysym The keysym of the key to check.
42
+ * @returns True if the key is repeatable, false otherwise.
43
+ */
44
+ static isKeyRepeatable(keySymbol) {
45
+ return !WebXKeyboardUtils.NON_REPEATABLE_KEYS.includes(keySymbol);
46
+ }
47
+ }
48
+ exports.WebXKeyboardUtils = WebXKeyboardUtils;
49
+ WebXKeyboardUtils.NON_REPEATABLE_KEYS = [
50
+ 0xfe03, // ISO Level 3 Shift (AltGr)
51
+ 0xffe1, // Left shift
52
+ 0xffe2, // Right shift
53
+ 0xffe3, // Left ctrl
54
+ 0xffe4, // Right ctrl
55
+ 0xffe5, // Caps Lock
56
+ 0xffe7, // Left meta
57
+ 0xffe8, // Right meta
58
+ 0xffe9, // Left alt
59
+ 0xffea, // Right alt
60
+ 0xffeb, // Left hyper
61
+ 0xffec // Right hyper
62
+ ];
63
+ //# sourceMappingURL=WebXKeyboardUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXKeyboardUtils.js","sourceRoot":"","sources":["../../../../src/input/keyboard/WebXKeyboardUtils.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,iBAAiB;IAC5B;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAAC,SAAiB;QAChD,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE;YAC1C,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,iCAAiC;QACjC,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;YAClC,OAAO,MAAM,GAAG,SAAS,CAAC;QAC5B,CAAC;QAED,0BAA0B;QAC1B,IAAI,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YAC/C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,sBAAsB;QACtB,IAAI,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;YACjD,iCAAiC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAiBD;;;;;;;OAOG;IACI,MAAM,CAAC,eAAe,CAAC,SAAiB;QAC7C,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;;AAxDH,8CAyDC;AA1Be,qCAAmB,GAAkB;IACjD,MAAM,EAAE,4BAA4B;IACpC,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,aAAa;IACrB,MAAM,CAAC,cAAc;CACtB,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { WebXKeyEvent } from './WebXKeyEvent';
2
+ /**
3
+ * Represents a keydown event in the WebX client.
4
+ *
5
+ * This event is triggered when a key is pressed down.
6
+ */
7
+ export declare class WebXKeydownEvent extends WebXKeyEvent {
8
+ /**
9
+ * Indicates whether the keyup event is reliable for this key.
10
+ */
11
+ readonly keyupReliable: boolean;
12
+ /**
13
+ * The JavaScript key code of the key pressed.
14
+ */
15
+ readonly keyCode: number;
16
+ /**
17
+ * The legacy DOM3 "keyIdentifier" of the key pressed.
18
+ */
19
+ readonly keyIdentifier: string;
20
+ /**
21
+ * The standard name of the key pressed.
22
+ */
23
+ readonly key: string;
24
+ /**
25
+ * The location on the keyboard corresponding to the key pressed.
26
+ */
27
+ readonly location: number;
28
+ /**
29
+ * Information related to the pressing of a key, which need not be a key
30
+ * associated with a printable character. The presence or absence of any
31
+ * information within this object is browser-dependent.
32
+ *
33
+ * @constructor
34
+ * @augments WebXKeyEvent
35
+ * @param {number} keyCode The JavaScript key code of the key pressed.
36
+ * @param {string} keyIdentifier The legacy DOM3 "keyIdentifier" of the key
37
+ * pressed, as defined at:
38
+ * http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#events-Events-KeyboardEvent
39
+ * @param {string} key The standard name of the key pressed, as defined at:
40
+ * http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
41
+ * @param {number} location The location on the keyboard corresponding to
42
+ * the key pressed, as defined at:
43
+ * http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
44
+ */
45
+ constructor(keyCode: number, keyIdentifier: string, key: string, location: number);
46
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebXKeydownEvent = void 0;
4
+ const WebXKeyEvent_1 = require("./WebXKeyEvent");
5
+ const WebXKeyboard_1 = require("../WebXKeyboard");
6
+ /**
7
+ * Represents a keydown event in the WebX client.
8
+ *
9
+ * This event is triggered when a key is pressed down.
10
+ */
11
+ class WebXKeydownEvent extends WebXKeyEvent_1.WebXKeyEvent {
12
+ /**
13
+ * Information related to the pressing of a key, which need not be a key
14
+ * associated with a printable character. The presence or absence of any
15
+ * information within this object is browser-dependent.
16
+ *
17
+ * @constructor
18
+ * @augments WebXKeyEvent
19
+ * @param {number} keyCode The JavaScript key code of the key pressed.
20
+ * @param {string} keyIdentifier The legacy DOM3 "keyIdentifier" of the key
21
+ * pressed, as defined at:
22
+ * http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#events-Events-KeyboardEvent
23
+ * @param {string} key The standard name of the key pressed, as defined at:
24
+ * http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
25
+ * @param {number} location The location on the keyboard corresponding to
26
+ * the key pressed, as defined at:
27
+ * http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
28
+ */
29
+ constructor(keyCode, keyIdentifier, key, location) {
30
+ super();
31
+ this.keyCode = keyCode;
32
+ this.keyIdentifier = keyIdentifier;
33
+ this.key = key;
34
+ this.location = location;
35
+ this.keyupReliable = !WebXKeyboard_1.WebXKeyboard.quirks.keyupUnreliable;
36
+ this._keysym = this.keysymFromKeyIdentifier(key, location) || this.keysymFromKeycode(keyCode, location);
37
+ if (this._keysym && !this.isPrintable()) {
38
+ this._reliable = true;
39
+ }
40
+ if (!this._keysym && this.keyIdentifierSane(keyCode, keyIdentifier)) {
41
+ this._keysym = this.keysymFromKeyIdentifier(keyIdentifier, location, WebXKeyboard_1.WebXKeyboard.modifiers.shift);
42
+ }
43
+ // If a key is pressed while meta is held down, the keyup will
44
+ // never be sent in Chrome (bug #108404)
45
+ if (WebXKeyboard_1.WebXKeyboard.modifiers.meta && this._keysym !== 0xFFE7 && this._keysym !== 0xFFE8) {
46
+ this.keyupReliable = false;
47
+ }
48
+ else if (this.keysym === 0xFFE5 && WebXKeyboard_1.WebXKeyboard.quirks.capsLockKeyupUnreliable) {
49
+ this.keyupReliable = false;
50
+ }
51
+ // Determine whether default action for Ctrl+combinations must be prevented
52
+ const preventAlt = !WebXKeyboard_1.WebXKeyboard.modifiers.ctrl && !WebXKeyboard_1.WebXKeyboard.quirks.altIsTypableOnly;
53
+ // Determine whether default action for Ctrl+combinations must be prevented
54
+ const preventCtrl = !WebXKeyboard_1.WebXKeyboard.modifiers.alt;
55
+ // We must rely on the (potentially buggy) keyIdentifier if preventing
56
+ // the default action is important
57
+ if ((preventCtrl && WebXKeyboard_1.WebXKeyboard.modifiers.ctrl)
58
+ || (preventAlt && WebXKeyboard_1.WebXKeyboard.modifiers.alt)
59
+ || WebXKeyboard_1.WebXKeyboard.modifiers.meta
60
+ || WebXKeyboard_1.WebXKeyboard.modifiers.hyper) {
61
+ this.reliable = true;
62
+ }
63
+ }
64
+ }
65
+ exports.WebXKeydownEvent = WebXKeydownEvent;
66
+ //# sourceMappingURL=WebXKeydownEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebXKeydownEvent.js","sourceRoot":"","sources":["../../../../src/input/keyboard/WebXKeydownEvent.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAC9C,kDAA+C;AAE/C;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,2BAAY;IA2BhD;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,OAAe,EAAE,aAAqB,EAAE,GAAW,EAAE,QAAgB;QAC/E,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,CAAC,2BAAY,CAAC,MAAM,CAAC,eAAe,CAAC;QAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAExG,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC;YACpE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,aAAa,EAAE,QAAQ,EAAE,2BAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACrG,CAAC;QAED,8DAA8D;QAC9D,wCAAwC;QACxC,IAAI,2BAAY,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;YACtF,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC7B,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,2BAAY,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC;YACjF,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC7B,CAAC;QAED,2EAA2E;QAC3E,MAAM,UAAU,GAAG,CAAC,2BAAY,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,2BAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAEzF,2EAA2E;QAC3E,MAAM,WAAW,GAAG,CAAC,2BAAY,CAAC,SAAS,CAAC,GAAG,CAAC;QAEhD,sEAAsE;QACtE,kCAAkC;QAClC,IAAI,CAAC,WAAW,IAAI,2BAAY,CAAC,SAAS,CAAC,IAAI,CAAC;eAC3C,CAAC,UAAU,IAAI,2BAAY,CAAC,SAAS,CAAC,GAAG,CAAC;eAC1C,2BAAY,CAAC,SAAS,CAAC,IAAI;eAC3B,2BAAY,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IAEH,CAAC;CACF;AArFD,4CAqFC"}
@@ -0,0 +1,6 @@
1
+ export * from './WebXKeyEvent';
2
+ export * from './WebXKeyboardModifierState';
3
+ export * from './WebXKeyPressEvent';
4
+ export * from './WebXKeydownEvent';
5
+ export * from './WebXKeyboardUtils';
6
+ export * from './WebXKeyUpEvent';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./WebXKeyEvent"), exports);
18
+ __exportStar(require("./WebXKeyboardModifierState"), exports);
19
+ __exportStar(require("./WebXKeyPressEvent"), exports);
20
+ __exportStar(require("./WebXKeydownEvent"), exports);
21
+ __exportStar(require("./WebXKeyboardUtils"), exports);
22
+ __exportStar(require("./WebXKeyUpEvent"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/input/keyboard/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8DAA4C;AAC5C,sDAAoC;AACpC,qDAAmC;AACnC,sDAAoC;AACpC,mDAAiC"}
@@ -0,0 +1,190 @@
1
+ export declare class WebXMouseState {
2
+ /**
3
+ * The current X position of the mouse pointer
4
+ */
5
+ private _x;
6
+ /**
7
+ * The current Y position of the mouse poinrter
8
+ */
9
+ private _y;
10
+ /**
11
+ * Whether the left mouse button is currently pressed.
12
+ */
13
+ private _left;
14
+ /**
15
+ * Whether the middle mouse button is currently pressed.
16
+ */
17
+ private _middle;
18
+ /**
19
+ * Whether the right mouse button is currently pressed.
20
+ */
21
+ private _right;
22
+ /**
23
+ * Whether the up mouse button is currently pressed. This is the fourth
24
+ * mouse button, associated with upward scrolling of the mouse scroll
25
+ * wheel.
26
+ */
27
+ private _up;
28
+ /**
29
+ * Whether the down mouse button is currently pressed. This is the fifth
30
+ * mouse button, associated with downward scrolling of the mouse scroll
31
+ * wheel.
32
+ */
33
+ private _down;
34
+ /**
35
+ * Whether the shift button is currently pressed.
36
+ */
37
+ private _shift;
38
+ /**
39
+ * Whether the ctrl button is currently pressed.
40
+ */
41
+ private _ctrl;
42
+ /**
43
+ * Whether the alt button is currently pressed.
44
+ */
45
+ private _alt;
46
+ /**
47
+ * Gets the current X position of the mouse pointer.
48
+ *
49
+ * @returns The X-coordinate as a number.
50
+ */
51
+ get x(): number;
52
+ /**
53
+ * Sets the current X position of the mouse pointer.
54
+ *
55
+ * @param value The new X-coordinate as a number.
56
+ */
57
+ set x(value: number);
58
+ /**
59
+ * Gets the current Y position of the mouse pointer.
60
+ *
61
+ * @returns The Y-coordinate as a number.
62
+ */
63
+ get y(): number;
64
+ /**
65
+ * Sets the current Y position of the mouse pointer.
66
+ *
67
+ * @param value The new Y-coordinate as a number.
68
+ */
69
+ set y(value: number);
70
+ /**
71
+ * Gets whether the left mouse button is currently pressed.
72
+ *
73
+ * @returns True if the left button is pressed, false otherwise.
74
+ */
75
+ get left(): boolean;
76
+ /**
77
+ * Sets whether the left mouse button is currently pressed.
78
+ *
79
+ * @param value True to indicate the left button is pressed, false otherwise.
80
+ */
81
+ set left(value: boolean);
82
+ /**
83
+ * Gets whether the middle mouse button is currently pressed.
84
+ *
85
+ * @returns True if the middle button is pressed, false otherwise.
86
+ */
87
+ get middle(): boolean;
88
+ /**
89
+ * Sets whether the middle mouse button is currently pressed.
90
+ *
91
+ * @param value True to indicate the middle button is pressed, false otherwise.
92
+ */
93
+ set middle(value: boolean);
94
+ /**
95
+ * Gets whether the right mouse button is currently pressed.
96
+ *
97
+ * @returns True if the right button is pressed, false otherwise.
98
+ */
99
+ get right(): boolean;
100
+ /**
101
+ * Sets whether the right mouse button is currently pressed.
102
+ *
103
+ * @param value True to indicate the right button is pressed, false otherwise.
104
+ */
105
+ set right(value: boolean);
106
+ /**
107
+ * Gets whether the up mouse button (scroll up) is currently pressed.
108
+ *
109
+ * @returns True if the up button is pressed, false otherwise.
110
+ */
111
+ get up(): boolean;
112
+ /**
113
+ * Sets whether the up mouse button (scroll up) is currently pressed.
114
+ *
115
+ * @param value True to indicate the up button is pressed, false otherwise.
116
+ */
117
+ set up(value: boolean);
118
+ /**
119
+ * Gets whether the down mouse button (scroll down) is currently pressed.
120
+ *
121
+ * @returns True if the down button is pressed, false otherwise.
122
+ */
123
+ get down(): boolean;
124
+ /**
125
+ * Sets whether the down mouse button (scroll down) is currently pressed.
126
+ *
127
+ * @param value True to indicate the down button is pressed, false otherwise.
128
+ */
129
+ set down(value: boolean);
130
+ /**
131
+ * Gets whether the shift key is currently pressed.
132
+ *
133
+ * @returns True if the shift key is pressed, false otherwise.
134
+ */
135
+ get shift(): boolean;
136
+ /**
137
+ * Sets whether the shift key is currently pressed.
138
+ *
139
+ * @param value True to indicate the shift key is pressed, false otherwise.
140
+ */
141
+ set shift(value: boolean);
142
+ /**
143
+ * Gets whether the ctrl key is currently pressed.
144
+ *
145
+ * @returns True if the ctrl key is pressed, false otherwise.
146
+ */
147
+ get ctrl(): boolean;
148
+ /**
149
+ * Sets whether the ctrl key is currently pressed.
150
+ *
151
+ * @param value True to indicate the ctrl key is pressed, false otherwise.
152
+ */
153
+ set ctrl(value: boolean);
154
+ /**
155
+ * Gets whether the alt key is currently pressed.
156
+ *
157
+ * @returns True if the alt key is pressed, false otherwise.
158
+ */
159
+ get alt(): boolean;
160
+ /**
161
+ * Sets whether the alt key is currently pressed.
162
+ *
163
+ * @param value True to indicate the alt key is pressed, false otherwise.
164
+ */
165
+ set alt(value: boolean);
166
+ /**
167
+ * Create a new mouse state instance
168
+ * @param state the mouse state
169
+ */
170
+ constructor(state: {
171
+ x: number;
172
+ y: number;
173
+ left: boolean;
174
+ middle: boolean;
175
+ right: boolean;
176
+ up: boolean;
177
+ down: boolean;
178
+ });
179
+ /**
180
+ * Releases all mouse buttons by setting their states to false.
181
+ */
182
+ releaseButtons(): void;
183
+ /**
184
+ * Generates a bitmask representing the current state of mouse buttons and modifiers.
185
+ *
186
+ * @returns A number representing the button mask.
187
+ */
188
+ getButtonMask(): number;
189
+ clone(): WebXMouseState;
190
+ }