@illgrenoble/webx-client 1.8.1 → 1.9.1

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 (291) 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/utils/WebXVersion.d.ts +4 -0
  289. package/dist/utils/WebXVersion.js +1 -0
  290. package/dist/utils/WebXVersion.js.map +1 -1
  291. package/package.json +5 -3
@@ -1,4 +1,3 @@
1
- import { WebXKeyboardModifierState } from './keyboard';
2
1
  /**
3
2
  * Represents the keyboard input device in the WebX client.
4
3
  *
@@ -6,83 +5,14 @@ import { WebXKeyboardModifierState } from './keyboard';
6
5
  * and provides methods to interact with the keyboard state.
7
6
  */
8
7
  export declare class WebXKeyboard {
9
- private static _NEXT_ID;
10
- /**
11
- * All modifiers and their states.
12
- */
13
- static modifiers: WebXKeyboardModifierState;
14
- /**
15
- * Set of known platform-specific or browser-specific quirks which must be
16
- * accounted for to properly interpret key events, even if the only way to
17
- * reliably detect that quirk is to platform/browser-sniff.
18
- */
19
- static quirks: {
20
- /**
21
- * Whether keyup events are universally unreliable.
22
- */
23
- keyupUnreliable: boolean;
24
- /**
25
- * Whether the Alt key is actually a modifier for typable keys and is
26
- * thus never used for keyboard shortcuts.
27
- */
28
- altIsTypableOnly: boolean;
29
- /**
30
- * Whether we can rely on receiving a keyup event for the Caps Lock
31
- * key.
32
- */
33
- capsLockKeyupUnreliable: boolean;
34
- };
35
- private readonly _keyboardId;
36
- private readonly _eventMarker;
37
- /**
38
- * The element to use to provide keyboard events
39
- */
40
- private readonly _element;
41
- /**
42
- * The state of every key, indexed by keysym. If a particular key is
43
- * pressed, the value of pressed for that keysym will be true. If a key
44
- * is not currently pressed, it will not be defined.
45
- */
46
- private _pressed;
47
- /**
48
- * The state of every key, indexed by keysym, for strictly those keys whose
49
- * status has been indirectly determined through observation of other key
50
- * events. If a particular key is implicitly pressed, the value of
51
- * implicitlyPressed for that keysym will be true. If a key
52
- * is not currently implicitly pressed (the key is not pressed OR the state
53
- * of the key is explicitly known), it will not be defined.
54
- */
55
- private _implicitlyPressed;
56
- /**
57
- * The last result of calling the onkeydown handler for each key, indexed
58
- * by keysym. This is used to prevent/allow default actions for key events,
59
- * even when the onkeydown handler cannot be called again because the key
60
- * is (theoretically) still pressed.
61
- */
62
- private _lastKeydownResult;
63
- /**
64
- * The keysym most recently associated with a given keycode when keydown
65
- * fired. This object maps keycodes to keysyms.
66
- */
67
- private _recentKeysym;
68
- /**
69
- * Timeout before key repeat starts.
70
- */
71
- private _keyRepeatTimeout;
72
- /**
73
- * Interval which presses and releases the last key pressed while that
74
- * key is still being held down.
75
- */
76
- private _keyRepeatInterval;
77
- private _events;
78
- private _keyDownHandler;
79
- private _keyPressHandler;
80
- private _keyUpHandler;
81
- get pressed(): {
82
- [index: number]: boolean;
83
- };
8
+ private _keyboard;
9
+ private _onKeyDown;
10
+ private _onKeyUp;
11
+ set onKeyDown(onKeyDown: (key: any) => void);
12
+ set onKeyUp(onKeyUp: (key: any) => void);
84
13
  /**
85
14
  * Constructs a new WebXKeyboard instance.
15
+ * This creates a Guacamole.Keyboard instance and attaches event listeners.
86
16
  *
87
17
  * @param element The HTML element to attach the keyboard events to.
88
18
  */
@@ -92,174 +22,22 @@ export declare class WebXKeyboard {
92
22
  */
93
23
  dispose(): void;
94
24
  /**
95
- * Set quirk flags depending on platform/browser, if such information is available
96
- */
97
- private _handleQuirks;
98
- /**
99
- * Adds a keyboard event to the internal event queue.
100
- *
101
- * @param event The keyboard event to add.
102
- */
103
- private _addEvent;
104
- /**
105
- * Bind the keyboard listeners to the given element
106
- */
107
- private _bindListeners;
108
- /**
109
- * Unbinds the keyboard listeners from the associated element.
110
- */
111
- private _unbindListeners;
112
- /**
113
- * Handles the keydown event by interpreting and processing it.
114
- *
115
- * @param event The keyboard event to handle.
116
- */
117
- private _bindKeyDownListener;
118
- /**
119
- * Handles the keypress event by interpreting and processing it.
120
- *
121
- * @param event The keyboard event to handle.
122
- */
123
- private _bindKeyPressListener;
124
- /**
125
- * Handles the keyup event by interpreting and processing it.
126
- *
127
- * @param event The keyboard event to handle.
128
- */
129
- private _bindKeyUpListener;
130
- /**
131
- * Returns the keyboard location of the key associated with the given
132
- * keyboard event. The location differentiates key events which otherwise
133
- * have the same keycode, such as left shift vs. right shift.
134
- *
135
- * @param event A JavaScript keyboard event, as received through the DOM via a "keydown", "keyup", or "keypress" handler.
136
- *
137
- * @returns {number}
138
- * The location of the key event on the keyboard, as defined at:
139
- * http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
140
- */
141
- private static _getEventLocation;
142
- /**
143
- * Attempts to mark the given Event as having been handled by this
144
- * keyboard. If the Event has already been marked as handled,
145
- * false is returned.
146
- *
147
- * @param event The Event to mark.
148
- * @returns true if the given Event was successfully marked, false if the given
149
- * Event was already marked.
150
- */
151
- private _markEvent;
152
- /**
153
- * Reads through the event log, removing events from the head of the log
154
- * when the corresponding true key presses are known (or as known as they
155
- * can be).
156
- *
157
- */
158
- private _interpretEvents;
159
- /**
160
- * Reads through the event log, interpreting the first event, if possible,
161
- * and returning that event. If no events can be interpreted, due to a
162
- * total lack of events or the need for more events, null is returned. Any
163
- * interpreted events are automatically removed from the log.
164
- *
165
- * The first key event in the log, if it can be interpreted, or null
166
- * otherwise.
167
- */
168
- private _interpretEvent;
169
- /**
170
- * Releases Ctrl+Alt, if both are currently pressed and the given keysym
171
- * looks like a key that may require AltGr.
172
- *
173
- * @param keysym The key that was just pressed.
174
- */
175
- private _releaseSimulatedAltgr;
176
- /**
177
- * Returns whether all currently pressed keys were implicitly pressed. A
178
- * key is implicitly pressed if its status was inferred indirectly from
179
- * inspection of other key events.
180
- *
181
- * @returns {boolean}
182
- * true if all currently pressed keys were implicitly pressed, false
183
- * otherwise.
184
- */
185
- private _isStateImplicit;
186
- /**
187
- * Check if a key is implicitly pressed
188
- * @param keysym the keysym to check
189
- */
190
- private _isImplicitlyPressed;
191
- /**
192
- * Given a keyboard event, updates the local modifier state and remote
193
- * key state based on the modifier flags within the event. This function
194
- * pays no attention to keycodes.
195
- *
196
- * @param event The keyboard event containing the flags to update.
197
- *
198
- * @param keyEvent Current best interpretation of the key event being processed.
199
- */
200
- private _syncModifierStates;
201
- /**
202
- * Given the remote and local state of a particular key, resynchronises the
203
- * remote state of that key with the local state through pressing or
204
- * releasing keysyms.
205
- *
206
- * @param remoteState Whether the key is currently pressed remotely.
207
- * @param localState Whether the key is currently pressed locally. If the state
208
- * of the key is not known, this may be undefined.
209
- * @param keysyms The keysyms which represent the key being updated.
210
- * @param keyEvent Best interpretation of the key event being processed.
211
- */
212
- private _updateModifierState;
213
- /**
214
- * Handle keydown event
215
- * @param keysym the key symbol
216
- */
217
- private _handleKeyDown;
218
- /**
219
- * Clears the timers used for key repeat functionality.
220
- */
221
- private _clearKeyRepeatTimers;
222
- /**
223
- * Checks if a key is currently pressed.
224
- *
225
- * @param keysym The keysym of the key to check.
226
- * @returns true if the key is pressed, false otherwise.
227
- */
228
- private _isKeyPressed;
229
- /**
230
- * Resets the state of this keyboard
25
+ * Resets the keyboard state.
26
+ * This clears any pressed keys and resets the keyboard to its initial state.
231
27
  */
232
28
  reset(): void;
233
- /**
234
- * Presses and releases the keys necessary to tpe the given string of characters
235
- * @param message the string to type
236
- */
237
- type(message: string): void;
238
- /**
239
- * Marks a key as pressed, firing the keydown event if registered. Key repeat for the pressed
240
- * key will start after a delay if that key is not a modifier.
241
- * The return value of this function depends on the return value of the keydown event handler, if any.
242
- * @param keysym the keysym of the key to press
243
- * @return {boolean} true if event should not be canceled, false otherwise.
244
- */
245
- press(keysym: number): boolean;
246
- /**
247
- * Marks a key as released, firing the keyup event if registered
248
- * @param keysym the keysym of the key to release.
249
- */
250
- release(keysym: number): void;
251
29
  /**
252
30
  * Fired whenever the user presses a key with the element associated
253
31
  * with this keyboard in focus.
254
32
  *
255
33
  * @param key The key being pressed
256
34
  */
257
- onKeyDown: (key: any) => void;
35
+ private onKeyDownHandler;
258
36
  /**
259
37
  * Fired whenever the user releases a key with the element associated
260
38
  * with this keyboard in focus.
261
39
  *
262
40
  * @param key The key being released
263
41
  */
264
- onKeyUp: (key: any) => void;
42
+ private onKeyUpHandler;
265
43
  }