@illgrenoble/webx-client 0.1.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.
- package/LICENSE +674 -0
- package/README.md +8 -0
- package/dist/WebXClient.d.ts +94 -0
- package/dist/WebXClient.js +302 -0
- package/dist/WebXClient.js.map +1 -0
- package/dist/display/WebXCursor.d.ts +28 -0
- package/dist/display/WebXCursor.js +94 -0
- package/dist/display/WebXCursor.js.map +1 -0
- package/dist/display/WebXCursorFactory.d.ts +18 -0
- package/dist/display/WebXCursorFactory.js +36 -0
- package/dist/display/WebXCursorFactory.js.map +1 -0
- package/dist/display/WebXDisplay.d.ts +70 -0
- package/dist/display/WebXDisplay.js +248 -0
- package/dist/display/WebXDisplay.js.map +1 -0
- package/dist/display/WebXSubImage.d.ts +19 -0
- package/dist/display/WebXSubImage.js +20 -0
- package/dist/display/WebXSubImage.js.map +1 -0
- package/dist/display/WebXTextureFactory.d.ts +14 -0
- package/dist/display/WebXTextureFactory.js +101 -0
- package/dist/display/WebXTextureFactory.js.map +1 -0
- package/dist/display/WebXWindow.d.ts +59 -0
- package/dist/display/WebXWindow.js +205 -0
- package/dist/display/WebXWindow.js.map +1 -0
- package/dist/display/WebXWindowProperties.d.ts +14 -0
- package/dist/display/WebXWindowProperties.js +17 -0
- package/dist/display/WebXWindowProperties.js.map +1 -0
- package/dist/display/index.d.ts +7 -0
- package/dist/display/index.js +24 -0
- package/dist/display/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/input/WebXKeyboard.d.ts +230 -0
- package/dist/input/WebXKeyboard.js +593 -0
- package/dist/input/WebXKeyboard.js.map +1 -0
- package/dist/input/WebXMouse.d.ts +97 -0
- package/dist/input/WebXMouse.js +205 -0
- package/dist/input/WebXMouse.js.map +1 -0
- package/dist/input/index.d.ts +4 -0
- package/dist/input/index.js +21 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/keyboard/WebXKeyEvent.d.ts +47 -0
- package/dist/input/keyboard/WebXKeyEvent.js +212 -0
- package/dist/input/keyboard/WebXKeyEvent.js.map +1 -0
- package/dist/input/keyboard/WebXKeyPressEvent.d.ts +13 -0
- package/dist/input/keyboard/WebXKeyPressEvent.js +26 -0
- package/dist/input/keyboard/WebXKeyPressEvent.js.map +1 -0
- package/dist/input/keyboard/WebXKeyUpEvent.d.ts +12 -0
- package/dist/input/keyboard/WebXKeyUpEvent.js +28 -0
- package/dist/input/keyboard/WebXKeyUpEvent.js.map +1 -0
- package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +47 -0
- package/dist/input/keyboard/WebXKeyboardModifierState.js +87 -0
- package/dist/input/keyboard/WebXKeyboardModifierState.js.map +1 -0
- package/dist/input/keyboard/WebXKeyboardUtils.d.ts +9 -0
- package/dist/input/keyboard/WebXKeyboardUtils.js +48 -0
- package/dist/input/keyboard/WebXKeyboardUtils.js.map +1 -0
- package/dist/input/keyboard/WebXKeydownEvent.d.ts +29 -0
- package/dist/input/keyboard/WebXKeydownEvent.js +71 -0
- package/dist/input/keyboard/WebXKeydownEvent.js.map +1 -0
- package/dist/input/keyboard/index.d.ts +6 -0
- package/dist/input/keyboard/index.js +23 -0
- package/dist/input/keyboard/index.js.map +1 -0
- package/dist/input/mouse/WebXMouseState.d.ts +78 -0
- package/dist/input/mouse/WebXMouseState.js +104 -0
- package/dist/input/mouse/WebXMouseState.js.map +1 -0
- package/dist/input/mouse/index.d.ts +1 -0
- package/dist/input/mouse/index.js +18 -0
- package/dist/input/mouse/index.js.map +1 -0
- package/dist/instruction/WebXConnectInstruction.d.ts +4 -0
- package/dist/instruction/WebXConnectInstruction.js +12 -0
- package/dist/instruction/WebXConnectInstruction.js.map +1 -0
- package/dist/instruction/WebXCursorImageInstruction.d.ts +6 -0
- package/dist/instruction/WebXCursorImageInstruction.js +16 -0
- package/dist/instruction/WebXCursorImageInstruction.js.map +1 -0
- package/dist/instruction/WebXImageInstruction.d.ts +7 -0
- package/dist/instruction/WebXImageInstruction.js +19 -0
- package/dist/instruction/WebXImageInstruction.js.map +1 -0
- package/dist/instruction/WebXInstruction.d.ts +13 -0
- package/dist/instruction/WebXInstruction.js +34 -0
- package/dist/instruction/WebXInstruction.js.map +1 -0
- package/dist/instruction/WebXInstructionResponse.d.ts +13 -0
- package/dist/instruction/WebXInstructionResponse.js +40 -0
- package/dist/instruction/WebXInstructionResponse.js.map +1 -0
- package/dist/instruction/WebXInstructionType.d.ts +13 -0
- package/dist/instruction/WebXInstructionType.js +38 -0
- package/dist/instruction/WebXInstructionType.js.map +1 -0
- package/dist/instruction/WebXKeyboardInstruction.d.ts +10 -0
- package/dist/instruction/WebXKeyboardInstruction.js +26 -0
- package/dist/instruction/WebXKeyboardInstruction.js.map +1 -0
- package/dist/instruction/WebXMouseInstruction.d.ts +13 -0
- package/dist/instruction/WebXMouseInstruction.js +33 -0
- package/dist/instruction/WebXMouseInstruction.js.map +1 -0
- package/dist/instruction/WebXQualityInstruction.d.ts +7 -0
- package/dist/instruction/WebXQualityInstruction.js +19 -0
- package/dist/instruction/WebXQualityInstruction.js.map +1 -0
- package/dist/instruction/WebXScreenInstruction.d.ts +4 -0
- package/dist/instruction/WebXScreenInstruction.js +12 -0
- package/dist/instruction/WebXScreenInstruction.js.map +1 -0
- package/dist/instruction/WebXWindowsInstruction.d.ts +4 -0
- package/dist/instruction/WebXWindowsInstruction.js +12 -0
- package/dist/instruction/WebXWindowsInstruction.js.map +1 -0
- package/dist/instruction/index.d.ts +11 -0
- package/dist/instruction/index.js +28 -0
- package/dist/instruction/index.js.map +1 -0
- package/dist/message/WebXCursorImageMessage.d.ts +17 -0
- package/dist/message/WebXCursorImageMessage.js +36 -0
- package/dist/message/WebXCursorImageMessage.js.map +1 -0
- package/dist/message/WebXImageMessage.d.ts +15 -0
- package/dist/message/WebXImageMessage.js +32 -0
- package/dist/message/WebXImageMessage.js.map +1 -0
- package/dist/message/WebXMessage.d.ts +8 -0
- package/dist/message/WebXMessage.js +17 -0
- package/dist/message/WebXMessage.js.map +1 -0
- package/dist/message/WebXMessageType.d.ts +10 -0
- package/dist/message/WebXMessageType.js +15 -0
- package/dist/message/WebXMessageType.js.map +1 -0
- package/dist/message/WebXMouseMessage.d.ts +10 -0
- package/dist/message/WebXMouseMessage.js +24 -0
- package/dist/message/WebXMouseMessage.js.map +1 -0
- package/dist/message/WebXPollMessage.d.ts +4 -0
- package/dist/message/WebXPollMessage.js +12 -0
- package/dist/message/WebXPollMessage.js.map +1 -0
- package/dist/message/WebXScreenMessage.d.ts +12 -0
- package/dist/message/WebXScreenMessage.js +16 -0
- package/dist/message/WebXScreenMessage.js.map +1 -0
- package/dist/message/WebXSubImagesMessage.d.ts +11 -0
- package/dist/message/WebXSubImagesMessage.js +24 -0
- package/dist/message/WebXSubImagesMessage.js.map +1 -0
- package/dist/message/WebXWindowsMessage.d.ts +7 -0
- package/dist/message/WebXWindowsMessage.js +16 -0
- package/dist/message/WebXWindowsMessage.js.map +1 -0
- package/dist/message/index.d.ts +9 -0
- package/dist/message/index.js +26 -0
- package/dist/message/index.js.map +1 -0
- package/dist/tracer/WebXHandler.d.ts +3 -0
- package/dist/tracer/WebXHandler.js +3 -0
- package/dist/tracer/WebXHandler.js.map +1 -0
- package/dist/tracer/WebXInstructionHandler.d.ts +4 -0
- package/dist/tracer/WebXInstructionHandler.js +7 -0
- package/dist/tracer/WebXInstructionHandler.js.map +1 -0
- package/dist/tracer/WebXMessageHandler.d.ts +4 -0
- package/dist/tracer/WebXMessageHandler.js +7 -0
- package/dist/tracer/WebXMessageHandler.js.map +1 -0
- package/dist/tracer/WebXStatsHandler.d.ts +7 -0
- package/dist/tracer/WebXStatsHandler.js +7 -0
- package/dist/tracer/WebXStatsHandler.js.map +1 -0
- package/dist/tracer/index.d.ts +4 -0
- package/dist/tracer/index.js +21 -0
- package/dist/tracer/index.js.map +1 -0
- package/dist/transport/WebXBinarySerializer.d.ts +11 -0
- package/dist/transport/WebXBinarySerializer.js +43 -0
- package/dist/transport/WebXBinarySerializer.js.map +1 -0
- package/dist/transport/WebXInstructionBuffer.d.ts +35 -0
- package/dist/transport/WebXInstructionBuffer.js +80 -0
- package/dist/transport/WebXInstructionBuffer.js.map +1 -0
- package/dist/transport/WebXInstructionEncoder.d.ts +101 -0
- package/dist/transport/WebXInstructionEncoder.js +175 -0
- package/dist/transport/WebXInstructionEncoder.js.map +1 -0
- package/dist/transport/WebXMessageBuffer.d.ts +19 -0
- package/dist/transport/WebXMessageBuffer.js +58 -0
- package/dist/transport/WebXMessageBuffer.js.map +1 -0
- package/dist/transport/WebXMessageDecoder.d.ts +16 -0
- package/dist/transport/WebXMessageDecoder.js +156 -0
- package/dist/transport/WebXMessageDecoder.js.map +1 -0
- package/dist/transport/index.d.ts +5 -0
- package/dist/transport/index.js +22 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/tunnel/WebXDefaultQoSHandler.d.ts +16 -0
- package/dist/tunnel/WebXDefaultQoSHandler.js +57 -0
- package/dist/tunnel/WebXDefaultQoSHandler.js.map +1 -0
- package/dist/tunnel/WebXQoSHandler.d.ts +6 -0
- package/dist/tunnel/WebXQoSHandler.js +7 -0
- package/dist/tunnel/WebXQoSHandler.js.map +1 -0
- package/dist/tunnel/WebXSocketIOTunnel.d.ts +15 -0
- package/dist/tunnel/WebXSocketIOTunnel.js +41 -0
- package/dist/tunnel/WebXSocketIOTunnel.js.map +1 -0
- package/dist/tunnel/WebXTunnel.d.ts +24 -0
- package/dist/tunnel/WebXTunnel.js +106 -0
- package/dist/tunnel/WebXTunnel.js.map +1 -0
- package/dist/tunnel/WebXWebSocketTunnel.d.ts +12 -0
- package/dist/tunnel/WebXWebSocketTunnel.js +41 -0
- package/dist/tunnel/WebXWebSocketTunnel.js.map +1 -0
- package/dist/tunnel/index.d.ts +5 -0
- package/dist/tunnel/index.js +22 -0
- package/dist/tunnel/index.js.map +1 -0
- package/dist/utils/Config.d.ts +4 -0
- package/dist/utils/Config.js +10 -0
- package/dist/utils/Config.js.map +1 -0
- package/dist/utils/WebXAsyncExec.d.ts +5 -0
- package/dist/utils/WebXAsyncExec.js +18 -0
- package/dist/utils/WebXAsyncExec.js.map +1 -0
- package/dist/utils/WebXColourGenerator.d.ts +5 -0
- package/dist/utils/WebXColourGenerator.js +27 -0
- package/dist/utils/WebXColourGenerator.js.map +1 -0
- package/dist/utils/WebXFileSize.d.ts +3 -0
- package/dist/utils/WebXFileSize.js +14 -0
- package/dist/utils/WebXFileSize.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { WebXMouseState } from './mouse';
|
|
2
|
+
export declare class WebXMouse {
|
|
3
|
+
private _element;
|
|
4
|
+
/**
|
|
5
|
+
* The current mouse state. The properties of this state are updated when
|
|
6
|
+
* mouse events fire. This state object is also passed in as a parameter to
|
|
7
|
+
* the handler of any mouse events.
|
|
8
|
+
*/
|
|
9
|
+
private _currentState;
|
|
10
|
+
private _contextMenuHandler;
|
|
11
|
+
private _mouseMoveHandler;
|
|
12
|
+
private _mouseDownHandler;
|
|
13
|
+
private _mouseUpHandler;
|
|
14
|
+
private _mouseOutHandler;
|
|
15
|
+
private _mouseWheelHandler;
|
|
16
|
+
/**
|
|
17
|
+
* Provides cross-browser mouse events for a given element
|
|
18
|
+
* @param _element The element to use to provide mouse events
|
|
19
|
+
*/
|
|
20
|
+
constructor(_element: HTMLElement);
|
|
21
|
+
dispose(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Cancel an event
|
|
24
|
+
* @param event the event to cancel
|
|
25
|
+
*/
|
|
26
|
+
private _cancelEvent;
|
|
27
|
+
/**
|
|
28
|
+
* Bind the mouse listeners to the given element
|
|
29
|
+
*/
|
|
30
|
+
private _bindListeners;
|
|
31
|
+
private _unbindListeners;
|
|
32
|
+
private _createDefaultState;
|
|
33
|
+
/**
|
|
34
|
+
* Process mouse up event
|
|
35
|
+
* @param event the mouse event
|
|
36
|
+
*/
|
|
37
|
+
private _handleMouseUp;
|
|
38
|
+
/**
|
|
39
|
+
* Process mouse down event
|
|
40
|
+
* @param event the mouse event
|
|
41
|
+
*/
|
|
42
|
+
private _handleMouseDown;
|
|
43
|
+
/**
|
|
44
|
+
* Process mouse wheel event
|
|
45
|
+
* @param event the mouse event
|
|
46
|
+
*/
|
|
47
|
+
private _handleMouseWheel;
|
|
48
|
+
/**
|
|
49
|
+
* Process mouse out event
|
|
50
|
+
* @param event the mouse event
|
|
51
|
+
*/
|
|
52
|
+
private _handleMouseOut;
|
|
53
|
+
/**
|
|
54
|
+
* Process the mouse move event
|
|
55
|
+
* @param event the mouse event
|
|
56
|
+
*/
|
|
57
|
+
private _handleMouseMove;
|
|
58
|
+
/**
|
|
59
|
+
* Resets the mouse state
|
|
60
|
+
*/
|
|
61
|
+
reset(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Process the context menu event
|
|
64
|
+
* Block context menu so right-click gets sent properly
|
|
65
|
+
* @param event the mouse event
|
|
66
|
+
*/
|
|
67
|
+
private _handleContextMenu;
|
|
68
|
+
/**
|
|
69
|
+
* Fired whenever the user moves the mouse
|
|
70
|
+
* @param mouseState the current mouse state
|
|
71
|
+
*/
|
|
72
|
+
onMouseMove(mouseState: WebXMouseState): void;
|
|
73
|
+
/**
|
|
74
|
+
* Fired whenever a mouse button is effectively pressed. This can happen
|
|
75
|
+
* as part of a "click" gesture initiated by the user by tapping one
|
|
76
|
+
* or more fingers over the touchpad element, as part of a "scroll"
|
|
77
|
+
* gesture initiated by dragging two fingers up or down, etc.
|
|
78
|
+
*
|
|
79
|
+
* @param mouseState the current mouse state
|
|
80
|
+
*/
|
|
81
|
+
onMouseDown(mouseState: WebXMouseState): void;
|
|
82
|
+
/**
|
|
83
|
+
* Fired whenever a mouse button is effectively released. This can happen
|
|
84
|
+
* as part of a "click" gesture initiated by the user by tapping one
|
|
85
|
+
* or more fingers over the touchpad element, as part of a "scroll"
|
|
86
|
+
* gesture initiated by dragging two fingers up or down, etc.
|
|
87
|
+
* @param mouseState the current mouse state
|
|
88
|
+
*/
|
|
89
|
+
onMouseUp(mouseState: WebXMouseState): void;
|
|
90
|
+
/**
|
|
91
|
+
* Fired whenever the mouse leaves the boundaries of the element associated
|
|
92
|
+
* with this mouse
|
|
93
|
+
*
|
|
94
|
+
* @param mouseState the current mouse state
|
|
95
|
+
*/
|
|
96
|
+
onMouseOut(mouseState: WebXMouseState): void;
|
|
97
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebXMouse = void 0;
|
|
4
|
+
const mouse_1 = require("./mouse");
|
|
5
|
+
class WebXMouse {
|
|
6
|
+
/**
|
|
7
|
+
* Provides cross-browser mouse events for a given element
|
|
8
|
+
* @param _element The element to use to provide mouse events
|
|
9
|
+
*/
|
|
10
|
+
constructor(_element) {
|
|
11
|
+
this._element = _element;
|
|
12
|
+
this._contextMenuHandler = this._handleContextMenu.bind(this);
|
|
13
|
+
this._mouseMoveHandler = this._handleMouseMove.bind(this);
|
|
14
|
+
this._mouseDownHandler = this._handleMouseDown.bind(this);
|
|
15
|
+
this._mouseUpHandler = this._handleMouseUp.bind(this);
|
|
16
|
+
this._mouseOutHandler = this._handleMouseOut.bind(this);
|
|
17
|
+
this._mouseWheelHandler = this._handleMouseWheel.bind(this);
|
|
18
|
+
this._bindListeners();
|
|
19
|
+
this._createDefaultState();
|
|
20
|
+
}
|
|
21
|
+
dispose() {
|
|
22
|
+
this._unbindListeners();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Cancel an event
|
|
26
|
+
* @param event the event to cancel
|
|
27
|
+
*/
|
|
28
|
+
_cancelEvent(event) {
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
if (event.preventDefault) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
}
|
|
33
|
+
event.returnValue = false;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Bind the mouse listeners to the given element
|
|
37
|
+
*/
|
|
38
|
+
_bindListeners() {
|
|
39
|
+
const element = this._element;
|
|
40
|
+
element.addEventListener('contextmenu', this._contextMenuHandler, false);
|
|
41
|
+
element.addEventListener('mousemove', this._mouseMoveHandler);
|
|
42
|
+
element.addEventListener('mousedown', this._mouseDownHandler);
|
|
43
|
+
element.addEventListener('mouseup', this._mouseUpHandler);
|
|
44
|
+
element.addEventListener('mouseout', this._mouseOutHandler);
|
|
45
|
+
['DOMMouseScroll', 'mousewheel', 'wheel'].forEach(listener => {
|
|
46
|
+
element.addEventListener(listener, this._mouseWheelHandler, { passive: false });
|
|
47
|
+
});
|
|
48
|
+
this.reset = this.reset.bind(this);
|
|
49
|
+
}
|
|
50
|
+
_unbindListeners() {
|
|
51
|
+
const element = this._element;
|
|
52
|
+
element.removeEventListener('contextmenu', this._contextMenuHandler, false);
|
|
53
|
+
element.removeEventListener('mousemove', this._mouseMoveHandler);
|
|
54
|
+
element.removeEventListener('mousedown', this._mouseDownHandler);
|
|
55
|
+
element.removeEventListener('mouseup', this._mouseUpHandler);
|
|
56
|
+
element.removeEventListener('mouseout', this._mouseOutHandler);
|
|
57
|
+
['DOMMouseScroll', 'mousewheel', 'wheel'].forEach(listener => {
|
|
58
|
+
element.removeEventListener(listener, this._mouseWheelHandler);
|
|
59
|
+
});
|
|
60
|
+
this.reset = this.reset.bind(this);
|
|
61
|
+
}
|
|
62
|
+
_createDefaultState() {
|
|
63
|
+
this._currentState = new mouse_1.WebXMouseState({
|
|
64
|
+
x: 0,
|
|
65
|
+
y: 0,
|
|
66
|
+
left: false,
|
|
67
|
+
middle: false,
|
|
68
|
+
right: false,
|
|
69
|
+
up: false,
|
|
70
|
+
down: false
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Process mouse up event
|
|
75
|
+
* @param event the mouse event
|
|
76
|
+
*/
|
|
77
|
+
_handleMouseUp(event) {
|
|
78
|
+
const currentState = this._currentState;
|
|
79
|
+
switch (event.button) {
|
|
80
|
+
case 0:
|
|
81
|
+
currentState.left = false;
|
|
82
|
+
break;
|
|
83
|
+
case 1:
|
|
84
|
+
currentState.middle = false;
|
|
85
|
+
break;
|
|
86
|
+
case 2:
|
|
87
|
+
currentState.right = false;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
this.onMouseUp(currentState);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Process mouse down event
|
|
94
|
+
* @param event the mouse event
|
|
95
|
+
*/
|
|
96
|
+
_handleMouseDown(event) {
|
|
97
|
+
this._cancelEvent(event);
|
|
98
|
+
const currentState = this._currentState;
|
|
99
|
+
switch (event.button) {
|
|
100
|
+
case 0:
|
|
101
|
+
currentState.left = true;
|
|
102
|
+
break;
|
|
103
|
+
case 1:
|
|
104
|
+
currentState.middle = true;
|
|
105
|
+
break;
|
|
106
|
+
case 2:
|
|
107
|
+
currentState.right = true;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
this.onMouseDown(currentState);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Process mouse wheel event
|
|
114
|
+
* @param event the mouse event
|
|
115
|
+
*/
|
|
116
|
+
_handleMouseWheel(event) {
|
|
117
|
+
const currentState = this._currentState;
|
|
118
|
+
if (event.deltaY < 0) {
|
|
119
|
+
currentState.up = true;
|
|
120
|
+
this.onMouseDown(currentState);
|
|
121
|
+
currentState.up = false;
|
|
122
|
+
this.onMouseUp(currentState);
|
|
123
|
+
}
|
|
124
|
+
if (event.deltaY > 0) {
|
|
125
|
+
currentState.down = true;
|
|
126
|
+
this.onMouseDown(currentState);
|
|
127
|
+
currentState.down = false;
|
|
128
|
+
this.onMouseUp(currentState);
|
|
129
|
+
}
|
|
130
|
+
this._cancelEvent(event);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Process mouse out event
|
|
134
|
+
* @param event the mouse event
|
|
135
|
+
*/
|
|
136
|
+
_handleMouseOut() {
|
|
137
|
+
// reset all buttons
|
|
138
|
+
const currentState = this._currentState;
|
|
139
|
+
currentState.releaseButtons();
|
|
140
|
+
this.onMouseUp(currentState);
|
|
141
|
+
this.onMouseOut(currentState);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Process the mouse move event
|
|
145
|
+
* @param event the mouse event
|
|
146
|
+
*/
|
|
147
|
+
_handleMouseMove(event) {
|
|
148
|
+
this._cancelEvent(event);
|
|
149
|
+
const currentState = this._currentState;
|
|
150
|
+
// get the container wrapping the display canvas element
|
|
151
|
+
const bounds = this._element.firstElementChild.getBoundingClientRect();
|
|
152
|
+
currentState.x = event.clientX - bounds.left;
|
|
153
|
+
currentState.y = event.clientY - bounds.top;
|
|
154
|
+
this.onMouseMove(currentState);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Resets the mouse state
|
|
158
|
+
*/
|
|
159
|
+
reset() {
|
|
160
|
+
this._createDefaultState();
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Process the context menu event
|
|
164
|
+
* Block context menu so right-click gets sent properly
|
|
165
|
+
* @param event the mouse event
|
|
166
|
+
*/
|
|
167
|
+
_handleContextMenu(event) {
|
|
168
|
+
this._cancelEvent(event);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Fired whenever the user moves the mouse
|
|
172
|
+
* @param mouseState the current mouse state
|
|
173
|
+
*/
|
|
174
|
+
// eslint-disable-next-line
|
|
175
|
+
onMouseMove(mouseState) { }
|
|
176
|
+
/**
|
|
177
|
+
* Fired whenever a mouse button is effectively pressed. This can happen
|
|
178
|
+
* as part of a "click" gesture initiated by the user by tapping one
|
|
179
|
+
* or more fingers over the touchpad element, as part of a "scroll"
|
|
180
|
+
* gesture initiated by dragging two fingers up or down, etc.
|
|
181
|
+
*
|
|
182
|
+
* @param mouseState the current mouse state
|
|
183
|
+
*/
|
|
184
|
+
// eslint-disable-next-line
|
|
185
|
+
onMouseDown(mouseState) { }
|
|
186
|
+
/**
|
|
187
|
+
* Fired whenever a mouse button is effectively released. This can happen
|
|
188
|
+
* as part of a "click" gesture initiated by the user by tapping one
|
|
189
|
+
* or more fingers over the touchpad element, as part of a "scroll"
|
|
190
|
+
* gesture initiated by dragging two fingers up or down, etc.
|
|
191
|
+
* @param mouseState the current mouse state
|
|
192
|
+
*/
|
|
193
|
+
// eslint-disable-next-line
|
|
194
|
+
onMouseUp(mouseState) { }
|
|
195
|
+
/**
|
|
196
|
+
* Fired whenever the mouse leaves the boundaries of the element associated
|
|
197
|
+
* with this mouse
|
|
198
|
+
*
|
|
199
|
+
* @param mouseState the current mouse state
|
|
200
|
+
*/
|
|
201
|
+
// eslint-disable-next-line
|
|
202
|
+
onMouseOut(mouseState) { }
|
|
203
|
+
}
|
|
204
|
+
exports.WebXMouse = WebXMouse;
|
|
205
|
+
//# sourceMappingURL=WebXMouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebXMouse.js","sourceRoot":"","sources":["../../src/input/WebXMouse.ts"],"names":[],"mappings":";;;AAAA,mCAAyC;AAEzC,MAAa,SAAS;IAepB;;;OAGG;IACH,YAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QAXjC,wBAAmB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzD,sBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,sBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,oBAAe,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,qBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,uBAAkB,GAAG,IAA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|
+
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("./WebXKeyboard"), exports);
|
|
18
|
+
__exportStar(require("./WebXMouse"), exports);
|
|
19
|
+
__exportStar(require("./mouse"), exports);
|
|
20
|
+
__exportStar(require("./keyboard"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A key event having a corresponding timestamp. This event is non-specific.
|
|
3
|
+
* Its subclasses should be used instead when recording specific key
|
|
4
|
+
* events.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class WebXKeyEvent {
|
|
7
|
+
/**
|
|
8
|
+
* Map of known JavaScript keyidentifiers which do not map to typable
|
|
9
|
+
* characters to their unshifted X11 keysym equivalents.
|
|
10
|
+
*/
|
|
11
|
+
static keyidentifier_keysym: {
|
|
12
|
+
[index: string]: Array<number>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Whether the default action of this key event should be prevented.
|
|
16
|
+
*/
|
|
17
|
+
protected _defaultPrevented: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The keysym of the key associated with this key event, as determined
|
|
20
|
+
* by a best-effort guess using available event properties and keyboard
|
|
21
|
+
* state.
|
|
22
|
+
*/
|
|
23
|
+
protected _keysym: number;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the keysym value of this key event is known to be reliable.
|
|
26
|
+
* If false, the keysym may still be valid, but it's only a best guess,
|
|
27
|
+
* and future key events may be a better source of information.
|
|
28
|
+
*/
|
|
29
|
+
protected _reliable: boolean;
|
|
30
|
+
get defaultPrevented(): boolean;
|
|
31
|
+
set defaultPrevented(defaultPrevented: boolean);
|
|
32
|
+
get keysym(): number;
|
|
33
|
+
set keysym(keysym: number);
|
|
34
|
+
get reliable(): boolean;
|
|
35
|
+
set reliable(reliable: boolean);
|
|
36
|
+
/**
|
|
37
|
+
* Returns true if the given keysym corresponds to a printable character,
|
|
38
|
+
* false otherwise.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Boolean}
|
|
41
|
+
* true if the given keysym corresponds to a printable character,
|
|
42
|
+
* false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
isPrintable(): boolean;
|
|
45
|
+
getKeysym(keysyms: Array<number>, location: number): number;
|
|
46
|
+
keysymFromKeyIdentifier(identifier: any, location: any, shifted?: any): number;
|
|
47
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebXKeyEvent = void 0;
|
|
4
|
+
const WebXKeyboardUtils_1 = require("./WebXKeyboardUtils");
|
|
5
|
+
/**
|
|
6
|
+
* A key event having a corresponding timestamp. This event is non-specific.
|
|
7
|
+
* Its subclasses should be used instead when recording specific key
|
|
8
|
+
* events.
|
|
9
|
+
*/
|
|
10
|
+
class WebXKeyEvent {
|
|
11
|
+
constructor() {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the default action of this key event should be prevented.
|
|
14
|
+
*/
|
|
15
|
+
this._defaultPrevented = false;
|
|
16
|
+
/**
|
|
17
|
+
* The keysym of the key associated with this key event, as determined
|
|
18
|
+
* by a best-effort guess using available event properties and keyboard
|
|
19
|
+
* state.
|
|
20
|
+
*/
|
|
21
|
+
this._keysym = null;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the keysym value of this key event is known to be reliable.
|
|
24
|
+
* If false, the keysym may still be valid, but it's only a best guess,
|
|
25
|
+
* and future key events may be a better source of information.
|
|
26
|
+
*/
|
|
27
|
+
this._reliable = false;
|
|
28
|
+
}
|
|
29
|
+
get defaultPrevented() {
|
|
30
|
+
return this._defaultPrevented;
|
|
31
|
+
}
|
|
32
|
+
set defaultPrevented(defaultPrevented) {
|
|
33
|
+
this._defaultPrevented = defaultPrevented;
|
|
34
|
+
}
|
|
35
|
+
get keysym() {
|
|
36
|
+
return this._keysym;
|
|
37
|
+
}
|
|
38
|
+
set keysym(keysym) {
|
|
39
|
+
this._keysym = keysym;
|
|
40
|
+
}
|
|
41
|
+
get reliable() {
|
|
42
|
+
return this._reliable;
|
|
43
|
+
}
|
|
44
|
+
set reliable(reliable) {
|
|
45
|
+
this._reliable = reliable;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns true if the given keysym corresponds to a printable character,
|
|
49
|
+
* false otherwise.
|
|
50
|
+
*
|
|
51
|
+
* @returns {Boolean}
|
|
52
|
+
* true if the given keysym corresponds to a printable character,
|
|
53
|
+
* false otherwise.
|
|
54
|
+
*/
|
|
55
|
+
isPrintable() {
|
|
56
|
+
const keysym = this._keysym;
|
|
57
|
+
// Keysyms with Unicode equivalents are printable
|
|
58
|
+
return (keysym >= 0x00 && keysym <= 0xff) || (keysym & 0xffff0000) === 0x01000000;
|
|
59
|
+
}
|
|
60
|
+
getKeysym(keysyms, location) {
|
|
61
|
+
if (!keysyms) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return keysyms[location] || keysyms[0];
|
|
65
|
+
}
|
|
66
|
+
keysymFromKeyIdentifier(identifier, location, shifted) {
|
|
67
|
+
if (!identifier) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
let typedCharacter;
|
|
71
|
+
// If identifier is U+xxxx, decode Unicode character
|
|
72
|
+
const unicodePrefixLocation = identifier.indexOf("U+");
|
|
73
|
+
if (unicodePrefixLocation >= 0) {
|
|
74
|
+
const hex = identifier.substring(unicodePrefixLocation + 2);
|
|
75
|
+
typedCharacter = String.fromCharCode(parseInt(hex, 16));
|
|
76
|
+
}
|
|
77
|
+
// If single character and not keypad, use that as typed character
|
|
78
|
+
else if (identifier.length === 1 && location !== 3) {
|
|
79
|
+
typedCharacter = identifier;
|
|
80
|
+
}
|
|
81
|
+
// Otherwise, look up corresponding keysym
|
|
82
|
+
else {
|
|
83
|
+
return this.getKeysym(WebXKeyEvent.keyidentifier_keysym[identifier], location);
|
|
84
|
+
}
|
|
85
|
+
// Alter case if necessary
|
|
86
|
+
if (shifted === true) {
|
|
87
|
+
typedCharacter = typedCharacter.toUpperCase();
|
|
88
|
+
}
|
|
89
|
+
else if (shifted === false) {
|
|
90
|
+
typedCharacter = typedCharacter.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
// Get codepoint
|
|
93
|
+
const codepoint = typedCharacter.charCodeAt(0);
|
|
94
|
+
return WebXKeyboardUtils_1.WebXKeyboardUtils.keysymFromCharCode(codepoint);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.WebXKeyEvent = WebXKeyEvent;
|
|
98
|
+
/**
|
|
99
|
+
* Map of known JavaScript keyidentifiers which do not map to typable
|
|
100
|
+
* characters to their unshifted X11 keysym equivalents.
|
|
101
|
+
*/
|
|
102
|
+
WebXKeyEvent.keyidentifier_keysym = {
|
|
103
|
+
Again: [0xff66],
|
|
104
|
+
AllCandidates: [0xff3d],
|
|
105
|
+
Alphanumeric: [0xff30],
|
|
106
|
+
Alt: [0xffe9, 0xffe9, 0xfe03],
|
|
107
|
+
Attn: [0xfd0e],
|
|
108
|
+
AltGraph: [0xfe03],
|
|
109
|
+
ArrowDown: [0xff54],
|
|
110
|
+
ArrowLeft: [0xff51],
|
|
111
|
+
ArrowRight: [0xff53],
|
|
112
|
+
ArrowUp: [0xff52],
|
|
113
|
+
Backspace: [0xff08],
|
|
114
|
+
CapsLock: [0xffe5],
|
|
115
|
+
Cancel: [0xff69],
|
|
116
|
+
Clear: [0xff0b],
|
|
117
|
+
Convert: [0xff21],
|
|
118
|
+
Copy: [0xfd15],
|
|
119
|
+
Crsel: [0xfd1c],
|
|
120
|
+
CrSel: [0xfd1c],
|
|
121
|
+
CodeInput: [0xff37],
|
|
122
|
+
Compose: [0xff20],
|
|
123
|
+
Control: [0xffe3, 0xffe3, 0xffe4],
|
|
124
|
+
ContextMenu: [0xff67],
|
|
125
|
+
Delete: [0xffff],
|
|
126
|
+
Down: [0xff54],
|
|
127
|
+
End: [0xff57],
|
|
128
|
+
Enter: [0xff0d],
|
|
129
|
+
EraseEof: [0xfd06],
|
|
130
|
+
Escape: [0xff1b],
|
|
131
|
+
Execute: [0xff62],
|
|
132
|
+
Exsel: [0xfd1d],
|
|
133
|
+
ExSel: [0xfd1d],
|
|
134
|
+
F1: [0xffbe],
|
|
135
|
+
F2: [0xffbf],
|
|
136
|
+
F3: [0xffc0],
|
|
137
|
+
F4: [0xffc1],
|
|
138
|
+
F5: [0xffc2],
|
|
139
|
+
F6: [0xffc3],
|
|
140
|
+
F7: [0xffc4],
|
|
141
|
+
F8: [0xffc5],
|
|
142
|
+
F9: [0xffc6],
|
|
143
|
+
F10: [0xffc7],
|
|
144
|
+
F11: [0xffc8],
|
|
145
|
+
F12: [0xffc9],
|
|
146
|
+
F13: [0xffca],
|
|
147
|
+
F14: [0xffcb],
|
|
148
|
+
F15: [0xffcc],
|
|
149
|
+
F16: [0xffcd],
|
|
150
|
+
F17: [0xffce],
|
|
151
|
+
F18: [0xffcf],
|
|
152
|
+
F19: [0xffd0],
|
|
153
|
+
F20: [0xffd1],
|
|
154
|
+
F21: [0xffd2],
|
|
155
|
+
F22: [0xffd3],
|
|
156
|
+
F23: [0xffd4],
|
|
157
|
+
F24: [0xffd5],
|
|
158
|
+
Find: [0xff68],
|
|
159
|
+
GroupFirst: [0xfe0c],
|
|
160
|
+
GroupLast: [0xfe0e],
|
|
161
|
+
GroupNext: [0xfe08],
|
|
162
|
+
GroupPrevious: [0xfe0a],
|
|
163
|
+
FullWidth: null,
|
|
164
|
+
HalfWidth: null,
|
|
165
|
+
HangulMode: [0xff31],
|
|
166
|
+
Hankaku: [0xff29],
|
|
167
|
+
HanjaMode: [0xff34],
|
|
168
|
+
Help: [0xff6a],
|
|
169
|
+
Hiragana: [0xff25],
|
|
170
|
+
HiraganaKatakana: [0xff27],
|
|
171
|
+
Home: [0xff50],
|
|
172
|
+
Hyper: [0xffed, 0xffed, 0xffee],
|
|
173
|
+
Insert: [0xff63],
|
|
174
|
+
JapaneseHiragana: [0xff25],
|
|
175
|
+
JapaneseKatakana: [0xff26],
|
|
176
|
+
JapaneseRomaji: [0xff24],
|
|
177
|
+
JunjaMode: [0xff38],
|
|
178
|
+
KanaMode: [0xff2d],
|
|
179
|
+
KanjiMode: [0xff21],
|
|
180
|
+
Katakana: [0xff26],
|
|
181
|
+
Left: [0xff51],
|
|
182
|
+
Meta: [0xffe7, 0xffe7, 0xffe8],
|
|
183
|
+
ModeChange: [0xff7e],
|
|
184
|
+
NumLock: [0xff7f],
|
|
185
|
+
PageDown: [0xff56],
|
|
186
|
+
PageUp: [0xff55],
|
|
187
|
+
Pause: [0xff13],
|
|
188
|
+
Play: [0xfd16],
|
|
189
|
+
PreviousCandidate: [0xff3e],
|
|
190
|
+
PrintScreen: [0xff61],
|
|
191
|
+
Redo: [0xff66],
|
|
192
|
+
Right: [0xff53],
|
|
193
|
+
RomanCharacters: null,
|
|
194
|
+
Scroll: [0xff14],
|
|
195
|
+
Select: [0xff60],
|
|
196
|
+
Separator: [0xffac],
|
|
197
|
+
Shift: [0xffe1, 0xffe1, 0xffe2],
|
|
198
|
+
SingleCandidate: [0xff3c],
|
|
199
|
+
Super: [0xffeb, 0xffeb, 0xffec],
|
|
200
|
+
Tab: [0xff09],
|
|
201
|
+
UIKeyInputDownArrow: [0xff54],
|
|
202
|
+
UIKeyInputEscape: [0xff1b],
|
|
203
|
+
UIKeyInputLeftArrow: [0xff51],
|
|
204
|
+
UIKeyInputRightArrow: [0xff53],
|
|
205
|
+
UIKeyInputUpArrow: [0xff52],
|
|
206
|
+
Up: [0xff52],
|
|
207
|
+
Undo: [0xff65],
|
|
208
|
+
Win: [0xffeb],
|
|
209
|
+
Zenkaku: [0xff28],
|
|
210
|
+
ZenkakuHankaku: [0xff2a]
|
|
211
|
+
};
|
|
212
|
+
//# sourceMappingURL=WebXKeyEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebXKeyEvent.js","sourceRoot":"","sources":["../../../src/input/keyboard/WebXKeyEvent.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AAExD;;;;GAIG;AACH,MAAsB,YAAY;IAAlC;QAsHE;;WAEG;QACO,sBAAiB,GAAG,KAAK,CAAC;QAEpC;;;;WAIG;QACO,YAAO,GAAW,IAAI,CAAC;QAEjC;;;;WAIG;QACO,cAAS,GAAG,KAAK,CAAC;IAwF9B,CAAC;IAtFC,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IAED,IAAW,gBAAgB,CAAC,gBAAyB;QACnD,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,MAAM,CAAC,MAAc;QAC9B,IAAI,CAAC,OAAO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AAE,CAAC,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,CAAC;IACnB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,CAAC,MAAM,CAAC;IACzB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAC/B,GAAG,EAAE,CAAC,MAAM,CAAC;IACb,mBAAmB,EAAE,CAAC,MAAM,CAAC;IAC7B,gBAAgB,EAAE,CAAC,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,MAAM,CAAC;IAC7B,oBAAoB,EAAE,CAAC,MAAM,CAAC;IAC9B,iBAAiB,EAAE,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,CAAC,MAAM,CAAC;IACZ,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,GAAG,EAAE,CAAC,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,MAAM,CAAC;IACjB,cAAc,EAAE,CAAC,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WebXKeyEvent } from './WebXKeyEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Information related to the pressing of a key, which MUST be
|
|
4
|
+
* associated with a printable character. The presence or absence of any
|
|
5
|
+
* information within this object is browser-dependent.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebXKeyPressEvent extends WebXKeyEvent {
|
|
8
|
+
private _key;
|
|
9
|
+
private readonly _location;
|
|
10
|
+
get key(): string;
|
|
11
|
+
get location(): number;
|
|
12
|
+
constructor(key: string, location: number);
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebXKeyPressEvent = void 0;
|
|
4
|
+
const WebXKeyEvent_1 = require("./WebXKeyEvent");
|
|
5
|
+
/**
|
|
6
|
+
* Information related to the pressing of a key, which MUST be
|
|
7
|
+
* associated with a printable character. The presence or absence of any
|
|
8
|
+
* information within this object is browser-dependent.
|
|
9
|
+
*/
|
|
10
|
+
class WebXKeyPressEvent extends WebXKeyEvent_1.WebXKeyEvent {
|
|
11
|
+
constructor(key, location) {
|
|
12
|
+
super();
|
|
13
|
+
this._key = key;
|
|
14
|
+
this._location = location;
|
|
15
|
+
this._keysym = this.keysymFromKeyIdentifier(key, location);
|
|
16
|
+
this.reliable = true;
|
|
17
|
+
}
|
|
18
|
+
get key() {
|
|
19
|
+
return this._key;
|
|
20
|
+
}
|
|
21
|
+
get location() {
|
|
22
|
+
return this._location;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.WebXKeyPressEvent = WebXKeyPressEvent;
|
|
26
|
+
//# sourceMappingURL=WebXKeyPressEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebXKeyPressEvent.js","sourceRoot":"","sources":["../../../src/input/keyboard/WebXKeyPressEvent.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,2BAAY;IAYjD,YAAY,GAAW,EAAE,QAAgB;QACvC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAE3D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAfD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CAUF;AApBD,8CAoBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WebXKeyEvent } from './WebXKeyEvent';
|
|
2
|
+
export declare class WebXKeyUpEvent extends WebXKeyEvent {
|
|
3
|
+
private readonly _keyCode;
|
|
4
|
+
private readonly _key;
|
|
5
|
+
private readonly _location;
|
|
6
|
+
private readonly _keyIdentifier;
|
|
7
|
+
get keyCode(): number;
|
|
8
|
+
get key(): string;
|
|
9
|
+
get location(): number;
|
|
10
|
+
get keyIdentifier(): string;
|
|
11
|
+
constructor(key: string, location: number);
|
|
12
|
+
}
|