@illgrenoble/webx-client 1.9.3 → 1.9.4
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.
- package/dist/input/GuacamoleKeyboard.js +118 -99
- package/dist/input/WebXKeyboard.d.ts +0 -16
- package/dist/input/WebXKeyboard.js +3 -26
- package/dist/input/WebXKeyboard.js.map +1 -1
- package/package.json +1 -1
- package/dist/display/WebXMaterialProvider.d.ts +0 -8
- package/dist/display/WebXMaterialProvider.js +0 -71
- package/dist/display/WebXMaterialProvider.js.map +0 -1
- package/dist/input/WebXNewKeyboard.d.ts +0 -62
- package/dist/input/WebXNewKeyboard.js +0 -94
- package/dist/input/WebXNewKeyboard.js.map +0 -1
- package/dist/input/keyboard/WebXKeyEvent.d.ts +0 -79
- package/dist/input/keyboard/WebXKeyEvent.js +0 -324
- package/dist/input/keyboard/WebXKeyEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
- package/dist/input/keyboard/WebXKeyPressEvent.js +0 -44
- package/dist/input/keyboard/WebXKeyPressEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
- package/dist/input/keyboard/WebXKeyUpEvent.js +0 -31
- package/dist/input/keyboard/WebXKeyUpEvent.js.map +0 -1
- package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
- package/dist/input/keyboard/WebXKeyboardModifierState.js +0 -148
- package/dist/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
- package/dist/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
- package/dist/input/keyboard/WebXKeyboardUtils.js +0 -63
- package/dist/input/keyboard/WebXKeyboardUtils.js.map +0 -1
- package/dist/input/keyboard/WebXKeydownEvent.d.ts +0 -46
- package/dist/input/keyboard/WebXKeydownEvent.js +0 -66
- package/dist/input/keyboard/WebXKeydownEvent.js.map +0 -1
- package/dist/input/keyboard/index.d.ts +0 -6
- package/dist/input/keyboard/index.js +0 -23
- package/dist/input/keyboard/index.js.map +0 -1
- package/dist/lib/GuacamoleKeyboard.js +0 -1290
- package/dist/lib/GuacamoleKeyboard.js.map +0 -1
- package/dist/message/WebXPollMessage.d.ts +0 -4
- package/dist/message/WebXPollMessage.js +0 -12
- package/dist/message/WebXPollMessage.js.map +0 -1
- package/dist/src/WebXClient.d.ts +0 -261
- package/dist/src/WebXClient.js +0 -571
- package/dist/src/WebXClient.js.map +0 -1
- package/dist/src/WebXEngine.d.ts +0 -4
- package/dist/src/WebXEngine.js +0 -7
- package/dist/src/WebXEngine.js.map +0 -1
- package/dist/src/display/WebXCursor.d.ts +0 -88
- package/dist/src/display/WebXCursor.js +0 -150
- package/dist/src/display/WebXCursor.js.map +0 -1
- package/dist/src/display/WebXCursorFactory.d.ts +0 -36
- package/dist/src/display/WebXCursorFactory.js +0 -59
- package/dist/src/display/WebXCursorFactory.js.map +0 -1
- package/dist/src/display/WebXDisplay.d.ts +0 -226
- package/dist/src/display/WebXDisplay.js +0 -424
- package/dist/src/display/WebXDisplay.js.map +0 -1
- package/dist/src/display/WebXMaterial.d.ts +0 -14
- package/dist/src/display/WebXMaterial.js +0 -140
- package/dist/src/display/WebXMaterial.js.map +0 -1
- package/dist/src/display/WebXSubImage.d.ts +0 -50
- package/dist/src/display/WebXSubImage.js +0 -26
- package/dist/src/display/WebXSubImage.js.map +0 -1
- package/dist/src/display/WebXTextureFactory.d.ts +0 -54
- package/dist/src/display/WebXTextureFactory.js +0 -160
- package/dist/src/display/WebXTextureFactory.js.map +0 -1
- package/dist/src/display/WebXWindow.d.ts +0 -241
- package/dist/src/display/WebXWindow.js +0 -438
- package/dist/src/display/WebXWindow.js.map +0 -1
- package/dist/src/display/WebXWindowProperties.d.ts +0 -44
- package/dist/src/display/WebXWindowProperties.js +0 -25
- package/dist/src/display/WebXWindowProperties.js.map +0 -1
- package/dist/src/display/index.d.ts +0 -7
- package/dist/src/display/index.js +0 -24
- package/dist/src/display/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -7
- package/dist/src/index.js +0 -24
- package/dist/src/index.js.map +0 -1
- package/dist/src/input/WebXKeyboard.d.ts +0 -265
- package/dist/src/input/WebXKeyboard.js +0 -632
- package/dist/src/input/WebXKeyboard.js.map +0 -1
- package/dist/src/input/WebXMouse.d.ts +0 -125
- package/dist/src/input/WebXMouse.js +0 -231
- package/dist/src/input/WebXMouse.js.map +0 -1
- package/dist/src/input/index.d.ts +0 -4
- package/dist/src/input/index.js +0 -21
- package/dist/src/input/index.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyEvent.d.ts +0 -79
- package/dist/src/input/keyboard/WebXKeyEvent.js +0 -324
- package/dist/src/input/keyboard/WebXKeyEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyPressEvent.d.ts +0 -30
- package/dist/src/input/keyboard/WebXKeyPressEvent.js +0 -44
- package/dist/src/input/keyboard/WebXKeyPressEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyUpEvent.d.ts +0 -33
- package/dist/src/input/keyboard/WebXKeyUpEvent.js +0 -31
- package/dist/src/input/keyboard/WebXKeyUpEvent.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyboardModifierState.d.ts +0 -108
- package/dist/src/input/keyboard/WebXKeyboardModifierState.js +0 -148
- package/dist/src/input/keyboard/WebXKeyboardModifierState.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeyboardUtils.d.ts +0 -25
- package/dist/src/input/keyboard/WebXKeyboardUtils.js +0 -63
- package/dist/src/input/keyboard/WebXKeyboardUtils.js.map +0 -1
- package/dist/src/input/keyboard/WebXKeydownEvent.d.ts +0 -46
- package/dist/src/input/keyboard/WebXKeydownEvent.js +0 -66
- package/dist/src/input/keyboard/WebXKeydownEvent.js.map +0 -1
- package/dist/src/input/keyboard/index.d.ts +0 -6
- package/dist/src/input/keyboard/index.js +0 -23
- package/dist/src/input/keyboard/index.js.map +0 -1
- package/dist/src/input/mouse/WebXMouseState.d.ts +0 -190
- package/dist/src/input/mouse/WebXMouseState.js +0 -217
- package/dist/src/input/mouse/WebXMouseState.js.map +0 -1
- package/dist/src/input/mouse/index.d.ts +0 -1
- package/dist/src/input/mouse/index.js +0 -18
- package/dist/src/input/mouse/index.js.map +0 -1
- package/dist/src/instruction/WebXClipboardInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXClipboardInstruction.js +0 -23
- package/dist/src/instruction/WebXClipboardInstruction.js.map +0 -1
- package/dist/src/instruction/WebXConnectInstruction.d.ts +0 -19
- package/dist/src/instruction/WebXConnectInstruction.js +0 -24
- package/dist/src/instruction/WebXConnectInstruction.js.map +0 -1
- package/dist/src/instruction/WebXCursorImageInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXCursorImageInstruction.js +0 -23
- package/dist/src/instruction/WebXCursorImageInstruction.js.map +0 -1
- package/dist/src/instruction/WebXDataAckInstruction.d.ts +0 -25
- package/dist/src/instruction/WebXDataAckInstruction.js +0 -26
- package/dist/src/instruction/WebXDataAckInstruction.js.map +0 -1
- package/dist/src/instruction/WebXImageInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXImageInstruction.js +0 -23
- package/dist/src/instruction/WebXImageInstruction.js.map +0 -1
- package/dist/src/instruction/WebXInstruction.d.ts +0 -29
- package/dist/src/instruction/WebXInstruction.js +0 -28
- package/dist/src/instruction/WebXInstruction.js.map +0 -1
- package/dist/src/instruction/WebXInstructionResponse.d.ts +0 -66
- package/dist/src/instruction/WebXInstructionResponse.js +0 -78
- package/dist/src/instruction/WebXInstructionResponse.js.map +0 -1
- package/dist/src/instruction/WebXInstructionType.d.ts +0 -63
- package/dist/src/instruction/WebXInstructionType.js +0 -96
- package/dist/src/instruction/WebXInstructionType.js.map +0 -1
- package/dist/src/instruction/WebXKeyboardInstruction.d.ts +0 -23
- package/dist/src/instruction/WebXKeyboardInstruction.js +0 -25
- package/dist/src/instruction/WebXKeyboardInstruction.js.map +0 -1
- package/dist/src/instruction/WebXMouseInstruction.d.ts +0 -28
- package/dist/src/instruction/WebXMouseInstruction.js +0 -27
- package/dist/src/instruction/WebXMouseInstruction.js.map +0 -1
- package/dist/src/instruction/WebXPongInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXPongInstruction.js +0 -23
- package/dist/src/instruction/WebXPongInstruction.js.map +0 -1
- package/dist/src/instruction/WebXQualityInstruction.d.ts +0 -19
- package/dist/src/instruction/WebXQualityInstruction.js +0 -24
- package/dist/src/instruction/WebXQualityInstruction.js.map +0 -1
- package/dist/src/instruction/WebXScreenInstruction.d.ts +0 -12
- package/dist/src/instruction/WebXScreenInstruction.js +0 -20
- package/dist/src/instruction/WebXScreenInstruction.js.map +0 -1
- package/dist/src/instruction/WebXShapeInstruction.d.ts +0 -18
- package/dist/src/instruction/WebXShapeInstruction.js +0 -23
- package/dist/src/instruction/WebXShapeInstruction.js.map +0 -1
- package/dist/src/instruction/WebXWindowsInstruction.d.ts +0 -13
- package/dist/src/instruction/WebXWindowsInstruction.js +0 -21
- package/dist/src/instruction/WebXWindowsInstruction.js.map +0 -1
- package/dist/src/instruction/index.d.ts +0 -15
- package/dist/src/instruction/index.js +0 -32
- package/dist/src/instruction/index.js.map +0 -1
- package/dist/src/message/WebXClipboardMessage.d.ts +0 -19
- package/dist/src/message/WebXClipboardMessage.js +0 -23
- package/dist/src/message/WebXClipboardMessage.js.map +0 -1
- package/dist/src/message/WebXConnectionMessage.d.ts +0 -12
- package/dist/src/message/WebXConnectionMessage.js +0 -20
- package/dist/src/message/WebXConnectionMessage.js.map +0 -1
- package/dist/src/message/WebXCursorImageMessage.d.ts +0 -46
- package/dist/src/message/WebXCursorImageMessage.js +0 -35
- package/dist/src/message/WebXCursorImageMessage.js.map +0 -1
- package/dist/src/message/WebXImageMessage.d.ts +0 -41
- package/dist/src/message/WebXImageMessage.js +0 -33
- package/dist/src/message/WebXImageMessage.js.map +0 -1
- package/dist/src/message/WebXMessage.d.ts +0 -24
- package/dist/src/message/WebXMessage.js +0 -23
- package/dist/src/message/WebXMessage.js.map +0 -1
- package/dist/src/message/WebXMessageType.d.ts +0 -59
- package/dist/src/message/WebXMessageType.js +0 -64
- package/dist/src/message/WebXMessageType.js.map +0 -1
- package/dist/src/message/WebXMouseMessage.d.ts +0 -30
- package/dist/src/message/WebXMouseMessage.js +0 -29
- package/dist/src/message/WebXMouseMessage.js.map +0 -1
- package/dist/src/message/WebXNopMessage.d.ts +0 -10
- package/dist/src/message/WebXNopMessage.js +0 -18
- package/dist/src/message/WebXNopMessage.js.map +0 -1
- package/dist/src/message/WebXPingMessage.d.ts +0 -13
- package/dist/src/message/WebXPingMessage.js +0 -21
- package/dist/src/message/WebXPingMessage.js.map +0 -1
- package/dist/src/message/WebXQualityMessage.d.ts +0 -39
- package/dist/src/message/WebXQualityMessage.js +0 -32
- package/dist/src/message/WebXQualityMessage.js.map +0 -1
- package/dist/src/message/WebXScreenMessage.d.ts +0 -37
- package/dist/src/message/WebXScreenMessage.js +0 -29
- package/dist/src/message/WebXScreenMessage.js.map +0 -1
- package/dist/src/message/WebXShapeMessage.d.ts +0 -31
- package/dist/src/message/WebXShapeMessage.js +0 -29
- package/dist/src/message/WebXShapeMessage.js.map +0 -1
- package/dist/src/message/WebXSubImagesMessage.d.ts +0 -31
- package/dist/src/message/WebXSubImagesMessage.js +0 -29
- package/dist/src/message/WebXSubImagesMessage.js.map +0 -1
- package/dist/src/message/WebXWindowsMessage.d.ts +0 -21
- package/dist/src/message/WebXWindowsMessage.js +0 -25
- package/dist/src/message/WebXWindowsMessage.js.map +0 -1
- package/dist/src/message/index.d.ts +0 -14
- package/dist/src/message/index.js +0 -31
- package/dist/src/message/index.js.map +0 -1
- package/dist/src/tracer/WebXDebugImageMessageHandler.d.ts +0 -48
- package/dist/src/tracer/WebXDebugImageMessageHandler.js +0 -102
- package/dist/src/tracer/WebXDebugImageMessageHandler.js.map +0 -1
- package/dist/src/tracer/WebXHandler.d.ts +0 -14
- package/dist/src/tracer/WebXHandler.js +0 -3
- package/dist/src/tracer/WebXHandler.js.map +0 -1
- package/dist/src/tracer/WebXInstructionHandler.d.ts +0 -21
- package/dist/src/tracer/WebXInstructionHandler.js +0 -13
- package/dist/src/tracer/WebXInstructionHandler.js.map +0 -1
- package/dist/src/tracer/WebXMessageHandler.d.ts +0 -21
- package/dist/src/tracer/WebXMessageHandler.js +0 -13
- package/dist/src/tracer/WebXMessageHandler.js.map +0 -1
- package/dist/src/tracer/WebXStatsHandler.d.ts +0 -23
- package/dist/src/tracer/WebXStatsHandler.js +0 -13
- package/dist/src/tracer/WebXStatsHandler.js.map +0 -1
- package/dist/src/tracer/index.d.ts +0 -5
- package/dist/src/tracer/index.js +0 -22
- package/dist/src/tracer/index.js.map +0 -1
- package/dist/src/transport/WebXBinarySerializer.d.ts +0 -31
- package/dist/src/transport/WebXBinarySerializer.js +0 -63
- package/dist/src/transport/WebXBinarySerializer.js.map +0 -1
- package/dist/src/transport/WebXInstructionBuffer.d.ts +0 -55
- package/dist/src/transport/WebXInstructionBuffer.js +0 -109
- package/dist/src/transport/WebXInstructionBuffer.js.map +0 -1
- package/dist/src/transport/WebXInstructionEncoder.d.ts +0 -181
- package/dist/src/transport/WebXInstructionEncoder.js +0 -294
- package/dist/src/transport/WebXInstructionEncoder.js.map +0 -1
- package/dist/src/transport/WebXMessageBuffer.d.ts +0 -80
- package/dist/src/transport/WebXMessageBuffer.js +0 -104
- package/dist/src/transport/WebXMessageBuffer.js.map +0 -1
- package/dist/src/transport/WebXMessageDecoder.d.ts +0 -108
- package/dist/src/transport/WebXMessageDecoder.js +0 -332
- package/dist/src/transport/WebXMessageDecoder.js.map +0 -1
- package/dist/src/transport/index.d.ts +0 -5
- package/dist/src/transport/index.js +0 -22
- package/dist/src/transport/index.js.map +0 -1
- package/dist/src/tunnel/WebXTunnel.d.ts +0 -93
- package/dist/src/tunnel/WebXTunnel.js +0 -156
- package/dist/src/tunnel/WebXTunnel.js.map +0 -1
- package/dist/src/tunnel/WebXWebSocketTunnel.d.ts +0 -40
- package/dist/src/tunnel/WebXWebSocketTunnel.js +0 -88
- package/dist/src/tunnel/WebXWebSocketTunnel.js.map +0 -1
- package/dist/src/tunnel/index.d.ts +0 -2
- package/dist/src/tunnel/index.js +0 -19
- package/dist/src/tunnel/index.js.map +0 -1
- package/dist/src/utils/WebXColorGenerator.d.ts +0 -24
- package/dist/src/utils/WebXColorGenerator.js +0 -46
- package/dist/src/utils/WebXColorGenerator.js.map +0 -1
- package/dist/src/utils/WebXVersion.d.ts +0 -34
- package/dist/src/utils/WebXVersion.js +0 -25
- package/dist/src/utils/WebXVersion.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -2
- package/dist/src/utils/index.js +0 -19
- package/dist/src/utils/index.js.map +0 -1
- package/dist/tracer/DemoVisualMessageHandler.d.ts +0 -15
- package/dist/tracer/DemoVisualMessageHandler.js +0 -55
- package/dist/tracer/DemoVisualMessageHandler.js.map +0 -1
- package/dist/tracer/WebXVisualMessageHandler.d.ts +0 -15
- package/dist/tracer/WebXVisualMessageHandler.js +0 -55
- package/dist/tracer/WebXVisualMessageHandler.js.map +0 -1
- package/dist/tunnel/WebXDefaultQoSHandler.d.ts +0 -16
- package/dist/tunnel/WebXDefaultQoSHandler.js +0 -57
- package/dist/tunnel/WebXDefaultQoSHandler.js.map +0 -1
- package/dist/tunnel/WebXQoSHandler.d.ts +0 -6
- package/dist/tunnel/WebXQoSHandler.js +0 -7
- package/dist/tunnel/WebXQoSHandler.js.map +0 -1
- package/dist/tunnel/WebXSocketIOTunnel.d.ts +0 -15
- package/dist/tunnel/WebXSocketIOTunnel.js +0 -41
- package/dist/tunnel/WebXSocketIOTunnel.js.map +0 -1
- package/dist/utils/ColorGenerator.d.ts +0 -24
- package/dist/utils/ColorGenerator.js +0 -46
- package/dist/utils/ColorGenerator.js.map +0 -1
- package/dist/utils/Config.d.ts +0 -4
- package/dist/utils/Config.js +0 -10
- package/dist/utils/Config.js.map +0 -1
- package/dist/utils/WebXAsyncExec.d.ts +0 -5
- package/dist/utils/WebXAsyncExec.js +0 -18
- package/dist/utils/WebXAsyncExec.js.map +0 -1
- package/dist/utils/WebXColourGenerator.d.ts +0 -5
- package/dist/utils/WebXColourGenerator.js +0 -27
- package/dist/utils/WebXColourGenerator.js.map +0 -1
- package/dist/utils/WebXFileSize.d.ts +0 -3
- package/dist/utils/WebXFileSize.js +0 -14
- package/dist/utils/WebXFileSize.js.map +0 -1
|
@@ -1299,138 +1299,143 @@ Guacamole.Keyboard = function Keyboard(element) {
|
|
|
1299
1299
|
|
|
1300
1300
|
};
|
|
1301
1301
|
|
|
1302
|
-
|
|
1303
|
-
* Attaches event listeners to the given Element, automatically translating
|
|
1304
|
-
* received key, input, and composition events into simple keydown/keyup
|
|
1305
|
-
* events signalled through this Guacamole.Keyboard's onkeydown and
|
|
1306
|
-
* onkeyup handlers.
|
|
1307
|
-
*
|
|
1308
|
-
* @param {!(Element|Document)} element
|
|
1309
|
-
* The Element to attach event listeners to for the sake of handling
|
|
1310
|
-
* key or input events.
|
|
1311
|
-
*/
|
|
1312
|
-
this.listenTo = function listenTo(element) {
|
|
1302
|
+
var keyDownListener = function(e) {
|
|
1313
1303
|
|
|
1314
|
-
//
|
|
1315
|
-
|
|
1304
|
+
// Only intercept if handler set
|
|
1305
|
+
if (!guac_keyboard.onkeydown) return;
|
|
1316
1306
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1307
|
+
// Ignore events which have already been handled
|
|
1308
|
+
if (!markEvent(e)) return;
|
|
1319
1309
|
|
|
1320
|
-
|
|
1321
|
-
if (!markEvent(e)) return;
|
|
1310
|
+
var keydownEvent = new KeydownEvent(e);
|
|
1322
1311
|
|
|
1323
|
-
|
|
1312
|
+
// Ignore (but do not prevent) the event if explicitly marked as composing,
|
|
1313
|
+
// or when the "composition" keycode sent by some browsers when an IME is in use
|
|
1314
|
+
// (see: http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html)
|
|
1315
|
+
if (e.isComposing || keydownEvent.keyCode === 229)
|
|
1316
|
+
return;
|
|
1324
1317
|
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
// (see: http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html)
|
|
1328
|
-
if (e.isComposing || keydownEvent.keyCode === 229)
|
|
1329
|
-
return;
|
|
1318
|
+
// Log event
|
|
1319
|
+
eventLog.push(keydownEvent);
|
|
1330
1320
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1321
|
+
// Interpret as many events as possible, prevent default if indicated
|
|
1322
|
+
if (interpret_events())
|
|
1323
|
+
e.preventDefault();
|
|
1333
1324
|
|
|
1334
|
-
|
|
1335
|
-
if (interpret_events())
|
|
1336
|
-
e.preventDefault();
|
|
1325
|
+
}
|
|
1337
1326
|
|
|
1338
|
-
|
|
1327
|
+
var keyPressListener = function(e) {
|
|
1339
1328
|
|
|
1340
|
-
//
|
|
1341
|
-
|
|
1329
|
+
// Only intercept if handler set
|
|
1330
|
+
if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
|
|
1342
1331
|
|
|
1343
|
-
|
|
1344
|
-
|
|
1332
|
+
// Ignore events which have already been handled
|
|
1333
|
+
if (!markEvent(e)) return;
|
|
1345
1334
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1335
|
+
// Log event
|
|
1336
|
+
eventLog.push(new KeypressEvent(e));
|
|
1348
1337
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1338
|
+
// Interpret as many events as possible, prevent default if indicated
|
|
1339
|
+
if (interpret_events())
|
|
1340
|
+
e.preventDefault();
|
|
1341
|
+
}
|
|
1351
1342
|
|
|
1352
|
-
|
|
1353
|
-
if (interpret_events())
|
|
1354
|
-
e.preventDefault();
|
|
1343
|
+
var keyUpListener = function(e) {
|
|
1355
1344
|
|
|
1356
|
-
|
|
1345
|
+
// Only intercept if handler set
|
|
1346
|
+
if (!guac_keyboard.onkeyup) return;
|
|
1357
1347
|
|
|
1358
|
-
//
|
|
1359
|
-
|
|
1348
|
+
// Ignore events which have already been handled
|
|
1349
|
+
if (!markEvent(e)) return;
|
|
1360
1350
|
|
|
1361
|
-
|
|
1362
|
-
if (!guac_keyboard.onkeyup) return;
|
|
1351
|
+
e.preventDefault();
|
|
1363
1352
|
|
|
1364
|
-
|
|
1365
|
-
|
|
1353
|
+
// Log event, call for interpretation
|
|
1354
|
+
eventLog.push(new KeyupEvent(e));
|
|
1355
|
+
interpret_events();
|
|
1356
|
+
}
|
|
1366
1357
|
|
|
1367
|
-
|
|
1358
|
+
/**
|
|
1359
|
+
* Handles the given "input" event, typing the data within the input text.
|
|
1360
|
+
*
|
|
1361
|
+
* @private
|
|
1362
|
+
* @param {!InputEvent} e
|
|
1363
|
+
* The "input" event to handle.
|
|
1364
|
+
*/
|
|
1365
|
+
var handleInput = function handleInput(e) {
|
|
1368
1366
|
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
interpret_events();
|
|
1367
|
+
// Only intercept if handler set
|
|
1368
|
+
if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
|
|
1372
1369
|
|
|
1373
|
-
|
|
1370
|
+
// Ignore events which have already been handled
|
|
1371
|
+
if (!markEvent(e)) return;
|
|
1374
1372
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
* @private
|
|
1379
|
-
* @param {!InputEvent} e
|
|
1380
|
-
* The "input" event to handle.
|
|
1381
|
-
*/
|
|
1382
|
-
var handleInput = function handleInput(e) {
|
|
1373
|
+
// Type all content written
|
|
1374
|
+
if (e.data && !e.isComposing)
|
|
1375
|
+
guac_keyboard.type(e.data);
|
|
1383
1376
|
|
|
1384
|
-
|
|
1385
|
-
if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
|
|
1377
|
+
};
|
|
1386
1378
|
|
|
1387
|
-
|
|
1388
|
-
|
|
1379
|
+
/**
|
|
1380
|
+
* Handles the given "compositionstart" event, automatically removing
|
|
1381
|
+
* the "input" event handler, as "input" events should only be handled
|
|
1382
|
+
* if composition events are not provided by the browser.
|
|
1383
|
+
*
|
|
1384
|
+
* @private
|
|
1385
|
+
* @param {!CompositionEvent} e
|
|
1386
|
+
* The "compositionstart" event to handle.
|
|
1387
|
+
*/
|
|
1388
|
+
var handleCompositionStart = function handleCompositionStart(e) {
|
|
1389
1389
|
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1390
|
+
// Remove the "input" event handler now that the browser is known
|
|
1391
|
+
// to send composition events
|
|
1392
|
+
element.removeEventListener("input", handleInput, false);
|
|
1393
1393
|
|
|
1394
|
-
|
|
1394
|
+
};
|
|
1395
1395
|
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
var handleCompositionStart = function handleCompositionStart(e) {
|
|
1396
|
+
/**
|
|
1397
|
+
* Handles the given "compositionend" event, typing the data within the
|
|
1398
|
+
* composed text.
|
|
1399
|
+
*
|
|
1400
|
+
* @private
|
|
1401
|
+
* @param {!CompositionEvent} e
|
|
1402
|
+
* The "compositionend" event to handle.
|
|
1403
|
+
*/
|
|
1404
|
+
var handleCompositionEnd = function handleCompositionEnd(e) {
|
|
1406
1405
|
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
element.removeEventListener("input", handleInput, false);
|
|
1406
|
+
// Only intercept if handler set
|
|
1407
|
+
if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
|
|
1410
1408
|
|
|
1411
|
-
|
|
1409
|
+
// Ignore events which have already been handled
|
|
1410
|
+
if (!markEvent(e)) return;
|
|
1412
1411
|
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
*
|
|
1417
|
-
* @private
|
|
1418
|
-
* @param {!CompositionEvent} e
|
|
1419
|
-
* The "compositionend" event to handle.
|
|
1420
|
-
*/
|
|
1421
|
-
var handleCompositionEnd = function handleCompositionEnd(e) {
|
|
1412
|
+
// Type all content written
|
|
1413
|
+
if (e.data)
|
|
1414
|
+
guac_keyboard.type(e.data);
|
|
1422
1415
|
|
|
1423
|
-
|
|
1424
|
-
if (!guac_keyboard.onkeydown && !guac_keyboard.onkeyup) return;
|
|
1416
|
+
};
|
|
1425
1417
|
|
|
1426
|
-
|
|
1427
|
-
|
|
1418
|
+
/**
|
|
1419
|
+
* Attaches event listeners to the given Element, automatically translating
|
|
1420
|
+
* received key, input, and composition events into simple keydown/keyup
|
|
1421
|
+
* events signalled through this Guacamole.Keyboard's onkeydown and
|
|
1422
|
+
* onkeyup handlers.
|
|
1423
|
+
*
|
|
1424
|
+
* @param {!(Element|Document)} element
|
|
1425
|
+
* The Element to attach event listeners to for the sake of handling
|
|
1426
|
+
* key or input events.
|
|
1427
|
+
*/
|
|
1428
|
+
this.listenTo = function listenTo(element) {
|
|
1428
1429
|
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1430
|
+
// When key pressed
|
|
1431
|
+
element.addEventListener("keydown", keyDownListener, true);
|
|
1432
|
+
|
|
1433
|
+
// When key pressed
|
|
1434
|
+
element.addEventListener("keypress", keyPressListener, true);
|
|
1435
|
+
|
|
1436
|
+
// When key released
|
|
1437
|
+
element.addEventListener("keyup", keyUpListener, true);
|
|
1432
1438
|
|
|
1433
|
-
};
|
|
1434
1439
|
|
|
1435
1440
|
// Automatically type text entered into the wrapped field
|
|
1436
1441
|
element.addEventListener("input", handleInput, false);
|
|
@@ -1443,8 +1448,22 @@ Guacamole.Keyboard = function Keyboard(element) {
|
|
|
1443
1448
|
if (element)
|
|
1444
1449
|
guac_keyboard.listenTo(element);
|
|
1445
1450
|
|
|
1451
|
+
this.dispose = function dispose() {
|
|
1452
|
+
// Stop listening to key events
|
|
1453
|
+
if (element) {
|
|
1454
|
+
element.removeEventListener("keydown", keyDownListener, true);
|
|
1455
|
+
element.removeEventListener("keypress", keyPressListener, true);
|
|
1456
|
+
element.removeEventListener("keyup", keyUpListener, true);
|
|
1457
|
+
element.removeEventListener("input", handleInput, false);
|
|
1458
|
+
element.removeEventListener("compositionend", handleCompositionEnd, false);
|
|
1459
|
+
element.removeEventListener("compositionstart", handleCompositionStart, false);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1446
1463
|
};
|
|
1447
1464
|
|
|
1465
|
+
|
|
1466
|
+
|
|
1448
1467
|
/**
|
|
1449
1468
|
* The unique numerical identifier to assign to the next Guacamole.Keyboard
|
|
1450
1469
|
* instance.
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class WebXKeyboard {
|
|
8
8
|
private _keyboard;
|
|
9
|
-
private _onKeyDown;
|
|
10
|
-
private _onKeyUp;
|
|
11
9
|
set onKeyDown(onKeyDown: (key: any) => void);
|
|
12
10
|
set onKeyUp(onKeyUp: (key: any) => void);
|
|
13
11
|
/**
|
|
@@ -26,18 +24,4 @@ export declare class WebXKeyboard {
|
|
|
26
24
|
* This clears any pressed keys and resets the keyboard to its initial state.
|
|
27
25
|
*/
|
|
28
26
|
reset(): void;
|
|
29
|
-
/**
|
|
30
|
-
* Fired whenever the user presses a key with the element associated
|
|
31
|
-
* with this keyboard in focus.
|
|
32
|
-
*
|
|
33
|
-
* @param key The key being pressed
|
|
34
|
-
*/
|
|
35
|
-
private onKeyDownHandler;
|
|
36
|
-
/**
|
|
37
|
-
* Fired whenever the user releases a key with the element associated
|
|
38
|
-
* with this keyboard in focus.
|
|
39
|
-
*
|
|
40
|
-
* @param key The key being released
|
|
41
|
-
*/
|
|
42
|
-
private onKeyUpHandler;
|
|
43
27
|
}
|
|
@@ -10,10 +10,10 @@ const Guacamole = require('./GuacamoleKeyboard');
|
|
|
10
10
|
*/
|
|
11
11
|
class WebXKeyboard {
|
|
12
12
|
set onKeyDown(onKeyDown) {
|
|
13
|
-
this.
|
|
13
|
+
this._keyboard.onkeydown = onKeyDown;
|
|
14
14
|
}
|
|
15
15
|
set onKeyUp(onKeyUp) {
|
|
16
|
-
this.
|
|
16
|
+
this._keyboard.onkeyup = onKeyUp;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Constructs a new WebXKeyboard instance.
|
|
@@ -22,11 +22,7 @@ class WebXKeyboard {
|
|
|
22
22
|
* @param element The HTML element to attach the keyboard events to.
|
|
23
23
|
*/
|
|
24
24
|
constructor(element) {
|
|
25
|
-
this._onKeyDown = () => { };
|
|
26
|
-
this._onKeyUp = () => { };
|
|
27
25
|
this._keyboard = new Guacamole.Keyboard(element);
|
|
28
|
-
this._keyboard.onkeydown = (key) => this.onKeyDownHandler(key);
|
|
29
|
-
this._keyboard.onkeyup = (key) => this.onKeyUpHandler(key);
|
|
30
26
|
}
|
|
31
27
|
/**
|
|
32
28
|
* Disposes of the keyboard instance and removes event listeners.
|
|
@@ -34,8 +30,7 @@ class WebXKeyboard {
|
|
|
34
30
|
dispose() {
|
|
35
31
|
this._keyboard.onkeydown = null;
|
|
36
32
|
this._keyboard.onkeyup = null;
|
|
37
|
-
this.
|
|
38
|
-
this.onKeyUp = () => { };
|
|
33
|
+
this._keyboard.dispose();
|
|
39
34
|
}
|
|
40
35
|
/**
|
|
41
36
|
* Resets the keyboard state.
|
|
@@ -44,24 +39,6 @@ class WebXKeyboard {
|
|
|
44
39
|
reset() {
|
|
45
40
|
this._keyboard.reset();
|
|
46
41
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Fired whenever the user presses a key with the element associated
|
|
49
|
-
* with this keyboard in focus.
|
|
50
|
-
*
|
|
51
|
-
* @param key The key being pressed
|
|
52
|
-
*/
|
|
53
|
-
onKeyDownHandler(key) {
|
|
54
|
-
this._onKeyDown(key);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Fired whenever the user releases a key with the element associated
|
|
58
|
-
* with this keyboard in focus.
|
|
59
|
-
*
|
|
60
|
-
* @param key The key being released
|
|
61
|
-
*/
|
|
62
|
-
onKeyUpHandler(key) {
|
|
63
|
-
this._onKeyUp(key);
|
|
64
|
-
}
|
|
65
42
|
}
|
|
66
43
|
exports.WebXKeyboard = WebXKeyboard;
|
|
67
44
|
//# sourceMappingURL=WebXKeyboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebXKeyboard.js","sourceRoot":"","sources":["../../src/input/WebXKeyboard.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"WebXKeyboard.js","sourceRoot":"","sources":["../../src/input/WebXKeyboard.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEjD;;;;;GAKG;AACH,MAAa,YAAY;IAIvB,IAAW,SAAS,CAAC,SAA6B;QAChD,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;IACvC,CAAC;IAED,IAAW,OAAO,CAAC,OAA2B;QAC5C,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,YAAY,OAA+B;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CAEF;AAvCD,oCAuCC"}
|
package/package.json
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXMaterial = void 0;
|
|
4
|
-
const three_1 = require("three");
|
|
5
|
-
const vertexShader = `
|
|
6
|
-
uniform mat3 mapTransform;
|
|
7
|
-
uniform mat3 alphaMapTransform;
|
|
8
|
-
|
|
9
|
-
varying vec2 vMapUv;
|
|
10
|
-
varying vec2 vAlphaMapUv;
|
|
11
|
-
|
|
12
|
-
void main() {
|
|
13
|
-
vMapUv = (mapTransform * vec3(uv, 1)).xy;
|
|
14
|
-
vAlphaMapUv = (alphaMapTransform * vec3(uv, 1)).xy;
|
|
15
|
-
|
|
16
|
-
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
19
|
-
const fragmentShader = `
|
|
20
|
-
uniform vec3 diffuse;
|
|
21
|
-
uniform float opacity;
|
|
22
|
-
uniform sampler2D map;
|
|
23
|
-
uniform sampler2D alphaMap;
|
|
24
|
-
|
|
25
|
-
varying vec2 vMapUv;
|
|
26
|
-
varying vec2 vAlphaMapUv;
|
|
27
|
-
|
|
28
|
-
void main() {
|
|
29
|
-
vec4 diffuseColor = vec4(diffuse, opacity);
|
|
30
|
-
|
|
31
|
-
vec4 sampledDiffuseColor = texture2D(map, vMapUv);
|
|
32
|
-
diffuseColor *= sampledDiffuseColor;
|
|
33
|
-
|
|
34
|
-
diffuseColor.a *= texture2D(alphaMap, vAlphaMapUv).g;
|
|
35
|
-
|
|
36
|
-
gl_FragColor = diffuseColor;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
class WebXMaterial extends three_1.ShaderMaterial {
|
|
40
|
-
get map() {
|
|
41
|
-
return this.uniforms.map.value;
|
|
42
|
-
}
|
|
43
|
-
set map(value) {
|
|
44
|
-
this.uniforms.map.value = value;
|
|
45
|
-
}
|
|
46
|
-
get alphaMap() {
|
|
47
|
-
return this.uniforms.alphaMap.value;
|
|
48
|
-
}
|
|
49
|
-
set alphaMap(value) {
|
|
50
|
-
this.uniforms.alphaMap.value = value;
|
|
51
|
-
}
|
|
52
|
-
constructor() {
|
|
53
|
-
super({
|
|
54
|
-
uniforms: {
|
|
55
|
-
map: { value: null },
|
|
56
|
-
alphaMap: { value: null },
|
|
57
|
-
mapTransform: { value: new three_1.Matrix3() },
|
|
58
|
-
alphaMapTransform: { value: new three_1.Matrix3() },
|
|
59
|
-
diffuse: { value: new three_1.Color(0xffffff) },
|
|
60
|
-
opacity: { value: 1.0 },
|
|
61
|
-
},
|
|
62
|
-
vertexShader,
|
|
63
|
-
fragmentShader,
|
|
64
|
-
transparent: true,
|
|
65
|
-
depthTest: false,
|
|
66
|
-
side: three_1.BackSide,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.WebXMaterial = WebXMaterial;
|
|
71
|
-
//# sourceMappingURL=WebXMaterialProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXMaterialProvider.js","sourceRoot":"","sources":["../../src/display/WebXMaterialProvider.ts"],"names":[],"mappings":";;;AAAA,iCAAqG;AAErG,MAAM,YAAY,GAAG;;;;;;;;;;;;;CAapB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEF,MAAa,YAAa,SAAQ,sBAAc;IAE9C,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,IAAI,GAAG,CAAC,KAAc;QACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,CAAC,KAAc;QACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IACvC,CAAC;IAED;QACE,KAAK,CAAC;YACJ,QAAQ,EAAE;gBACR,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;gBACpB,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;gBACzB,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,eAAO,EAAE,EAAE;gBACtC,iBAAiB,EAAE,EAAE,KAAK,EAAE,IAAI,eAAO,EAAE,EAAE;gBAC3C,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,aAAK,CAAC,QAAQ,CAAC,EAAE;gBACvC,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;aACxB;YACD,YAAY;YACZ,cAAc;YACd,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,KAAK;YAChB,IAAI,EAAE,gBAAQ;SACf,CAAC,CAAC;IACL,CAAC;CAEF;AApCD,oCAoCC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents the keyboard input device in the WebX client.
|
|
3
|
-
*
|
|
4
|
-
* This class handles keyboard events, such as key presses and releases,
|
|
5
|
-
* and provides methods to interact with the keyboard state.
|
|
6
|
-
*/
|
|
7
|
-
export declare class WebXNewKeyboard {
|
|
8
|
-
/**
|
|
9
|
-
* The element to use to provide keyboard events
|
|
10
|
-
*/
|
|
11
|
-
private readonly _element;
|
|
12
|
-
private _keyDownHandler;
|
|
13
|
-
private _keyUpHandler;
|
|
14
|
-
/**
|
|
15
|
-
* Constructs a new WebXKeyboard instance.
|
|
16
|
-
*
|
|
17
|
-
* @param element The HTML element to attach the keyboard events to.
|
|
18
|
-
*/
|
|
19
|
-
constructor(element: HTMLElement | Document);
|
|
20
|
-
/**
|
|
21
|
-
* Disposes of the keyboard instance and removes event listeners.
|
|
22
|
-
*/
|
|
23
|
-
dispose(): void;
|
|
24
|
-
/**
|
|
25
|
-
* Bind the keyboard listeners to the given element
|
|
26
|
-
*/
|
|
27
|
-
private _bindListeners;
|
|
28
|
-
/**
|
|
29
|
-
* Unbinds the keyboard listeners from the associated element.
|
|
30
|
-
*/
|
|
31
|
-
private _unbindListeners;
|
|
32
|
-
/**
|
|
33
|
-
* Handles the keydown event by interpreting and processing it.
|
|
34
|
-
*
|
|
35
|
-
* @param event The keyboard event to handle.
|
|
36
|
-
*/
|
|
37
|
-
private _bindKeyDownListener;
|
|
38
|
-
/**
|
|
39
|
-
* Handles the keyup event by interpreting and processing it.
|
|
40
|
-
*
|
|
41
|
-
* @param event The keyboard event to handle.
|
|
42
|
-
*/
|
|
43
|
-
private _bindKeyUpListener;
|
|
44
|
-
/**
|
|
45
|
-
* Resets the state of this keyboard
|
|
46
|
-
*/
|
|
47
|
-
reset(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Fired whenever the user presses a key with the element associated
|
|
50
|
-
* with this keyboard in focus.
|
|
51
|
-
*
|
|
52
|
-
* @param key The key being pressed
|
|
53
|
-
*/
|
|
54
|
-
onKeyDown: (key: any) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Fired whenever the user releases a key with the element associated
|
|
57
|
-
* with this keyboard in focus.
|
|
58
|
-
*
|
|
59
|
-
* @param key The key being released
|
|
60
|
-
*/
|
|
61
|
-
onKeyUp: (key: any) => void;
|
|
62
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebXNewKeyboard = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Represents the keyboard input device in the WebX client.
|
|
6
|
-
*
|
|
7
|
-
* This class handles keyboard events, such as key presses and releases,
|
|
8
|
-
* and provides methods to interact with the keyboard state.
|
|
9
|
-
*/
|
|
10
|
-
class WebXNewKeyboard {
|
|
11
|
-
/**
|
|
12
|
-
* Constructs a new WebXKeyboard instance.
|
|
13
|
-
*
|
|
14
|
-
* @param element The HTML element to attach the keyboard events to.
|
|
15
|
-
*/
|
|
16
|
-
constructor(element) {
|
|
17
|
-
this._keyDownHandler = this._bindKeyDownListener.bind(this);
|
|
18
|
-
this._keyUpHandler = this._bindKeyUpListener.bind(this);
|
|
19
|
-
/**
|
|
20
|
-
* Fired whenever the user presses a key with the element associated
|
|
21
|
-
* with this keyboard in focus.
|
|
22
|
-
*
|
|
23
|
-
* @param key The key being pressed
|
|
24
|
-
*/
|
|
25
|
-
this.onKeyDown = null;
|
|
26
|
-
/**
|
|
27
|
-
* Fired whenever the user releases a key with the element associated
|
|
28
|
-
* with this keyboard in focus.
|
|
29
|
-
*
|
|
30
|
-
* @param key The key being released
|
|
31
|
-
*/
|
|
32
|
-
this.onKeyUp = null;
|
|
33
|
-
this._element = element;
|
|
34
|
-
this._bindListeners();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Disposes of the keyboard instance and removes event listeners.
|
|
38
|
-
*/
|
|
39
|
-
dispose() {
|
|
40
|
-
this._unbindListeners();
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Bind the keyboard listeners to the given element
|
|
44
|
-
*/
|
|
45
|
-
_bindListeners() {
|
|
46
|
-
const element = this._element;
|
|
47
|
-
element.addEventListener('keydown', this._keyDownHandler, true);
|
|
48
|
-
element.addEventListener('keyup', this._keyUpHandler, true);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Unbinds the keyboard listeners from the associated element.
|
|
52
|
-
*/
|
|
53
|
-
_unbindListeners() {
|
|
54
|
-
const element = this._element;
|
|
55
|
-
element.removeEventListener('keydown', this._keyDownHandler, true);
|
|
56
|
-
element.removeEventListener('keyup', this._keyUpHandler, true);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Handles the keydown event by interpreting and processing it.
|
|
60
|
-
*
|
|
61
|
-
* @param event The keyboard event to handle.
|
|
62
|
-
*/
|
|
63
|
-
_bindKeyDownListener(event) {
|
|
64
|
-
console.log('KEY DOWN');
|
|
65
|
-
// Only intercept if handler set
|
|
66
|
-
if (!this.onKeyDown) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
event.stopPropagation();
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Handles the keyup event by interpreting and processing it.
|
|
74
|
-
*
|
|
75
|
-
* @param event The keyboard event to handle.
|
|
76
|
-
*/
|
|
77
|
-
_bindKeyUpListener(event) {
|
|
78
|
-
console.log('KEY UP');
|
|
79
|
-
// Only intercept if handler set
|
|
80
|
-
if (!this.onKeyUp) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Resets the state of this keyboard
|
|
86
|
-
*/
|
|
87
|
-
reset() {
|
|
88
|
-
// for (const keysym in this._pressed) {
|
|
89
|
-
// this.release(parseInt(keysym));
|
|
90
|
-
// }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.WebXNewKeyboard = WebXNewKeyboard;
|
|
94
|
-
//# sourceMappingURL=WebXNewKeyboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebXNewKeyboard.js","sourceRoot":"","sources":["../../src/input/WebXNewKeyboard.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,MAAa,eAAe;IAW1B;;;;OAIG;IACH,YAAY,OAA+B;QARnC,oBAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,kBAAa,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QA8E3D;;;;;WAKG;QACI,cAAS,GAAuB,IAAI,CAAC;QAE5C;;;;;WAKG;QACI,YAAO,GAAuB,IAAI,CAAC;QApFxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACK,cAAc;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QAChE,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACnE,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACK,oBAAoB,CAAC,KAAoB;QAC/C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,gCAAgC;QAChC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;IAC1B,CAAC;IAGD;;;;OAIG;IACK,kBAAkB,CAAC,KAAoB;QAC7C,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,gCAAgC;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;IAEH,CAAC;IAED;;OAEG;IACI,KAAK;QACV,wCAAwC;QACxC,oCAAoC;QACpC,IAAI;IAEN,CAAC;CAmBF;AAxGD,0CAwGC"}
|