@aiot-toolkit/emulator 2.0.6-beta.2 → 2.0.6-beta.3
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/lib/index.d.ts +3 -0
- package/lib/index.js +36 -0
- package/lib/instance/index.js +1 -1
- package/lib/static/proto/emulator_controller.proto +181 -26
- package/lib/static/proto/ui_controller_service.proto +147 -0
- package/lib/vvd/grpc/index.d.ts +16 -7
- package/lib/vvd/grpc/index.js +79 -16
- package/lib/vvd/grpc/types/GrpcClient.d.ts +43 -2
- package/lib/vvd/grpc/types/UiControllerClient.d.ts +23 -0
- package/lib/vvd/grpc/types/index.d.ts +3 -0
- package/lib/vvd/grpc/types/index.js +38 -0
- package/lib/vvd/grpc/types/proto-types.d.ts +178 -0
- package/lib/vvd/grpc/types/proto-types.js +50 -0
- package/lib/vvd/index.d.ts +2 -2
- package/lib/vvd/index.js +14 -7
- package/package.json +4 -8
- package/lib/vvd/grpc/types/KeyEvent.d.ts +0 -19
- package/lib/vvd/grpc/types/KeyEvent.js +0 -20
- package/lib/vvd/grpc/types/MouseEvent.d.ts +0 -30
- /package/lib/vvd/grpc/types/{MouseEvent.js → UiControllerClient.js} +0 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -87,4 +87,40 @@ Object.keys(_shared).forEach(function (key) {
|
|
|
87
87
|
return _shared[key];
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
+
});
|
|
91
|
+
var _index = require("./vvd/grpc/index");
|
|
92
|
+
Object.keys(_index).forEach(function (key) {
|
|
93
|
+
if (key === "default" || key === "__esModule") return;
|
|
94
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
95
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
96
|
+
Object.defineProperty(exports, key, {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _index[key];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
var _types = require("./vvd/grpc/types");
|
|
104
|
+
Object.keys(_types).forEach(function (key) {
|
|
105
|
+
if (key === "default" || key === "__esModule") return;
|
|
106
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
107
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
108
|
+
Object.defineProperty(exports, key, {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _types[key];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
var _logcat = require("./vvd/logcat");
|
|
116
|
+
Object.keys(_logcat).forEach(function (key) {
|
|
117
|
+
if (key === "default" || key === "__esModule") return;
|
|
118
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
119
|
+
if (key in exports && exports[key] === _logcat[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _logcat[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
90
126
|
});
|
package/lib/instance/index.js
CHANGED
|
@@ -53,7 +53,7 @@ function getInstanceClass(imageType) {
|
|
|
53
53
|
[_Vvd.VelaImageType.VELA_MIWEAR_WATCH_5]: _miwear2.VelaMiwear5,
|
|
54
54
|
[_Vvd.VelaImageType.VELA_MIWEAR_MINISOUND_5]: _minisound.MiniSound5
|
|
55
55
|
};
|
|
56
|
-
return map[imageType] ||
|
|
56
|
+
return map[imageType] || _miwear2.VelaMiwear5;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -57,6 +57,9 @@ service EmulatorController {
|
|
|
57
57
|
returns (stream PhysicalModelValue) {}
|
|
58
58
|
|
|
59
59
|
// Atomically set/get the current primary clipboard data.
|
|
60
|
+
// Note that a call to setClipboard will result in an immediate
|
|
61
|
+
// event for those who made a call to streamClipboard and are
|
|
62
|
+
// on a different channel than the one used to set the clipboard.
|
|
60
63
|
rpc setClipboard(ClipData) returns (google.protobuf.Empty) {}
|
|
61
64
|
rpc getClipboard(google.protobuf.Empty) returns (ClipData) {}
|
|
62
65
|
|
|
@@ -176,15 +179,13 @@ service EmulatorController {
|
|
|
176
179
|
// already.
|
|
177
180
|
rpc injectAudio(stream AudioPacket) returns (google.protobuf.Empty) {}
|
|
178
181
|
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
// Deprecated, please use the streamLogcat method instead.
|
|
183
|
+
rpc getLogcat(LogMessage) returns (LogMessage) {
|
|
184
|
+
option deprecated = true;
|
|
185
|
+
}
|
|
183
186
|
|
|
184
|
-
// Streams the logcat output from the emulator.
|
|
185
|
-
// can retrieve up to 128Kb. This call will not return.
|
|
187
|
+
// Streams the logcat output from the emulator.
|
|
186
188
|
// Note that parsed logcat messages are only available after L (Api >23)
|
|
187
|
-
// it is possible that the logcat buffer gets overwritten, or falls behind.
|
|
188
189
|
rpc streamLogcat(LogMessage) returns (stream LogMessage) {}
|
|
189
190
|
|
|
190
191
|
// Transition the virtual machine to the desired state. Note that
|
|
@@ -233,10 +234,19 @@ service EmulatorController {
|
|
|
233
234
|
rpc streamNotification(google.protobuf.Empty)
|
|
234
235
|
returns (stream Notification) {}
|
|
235
236
|
|
|
236
|
-
//
|
|
237
|
+
// Rotation angles are relative to the camera's current orientation.
|
|
238
|
+
// The coordinate system is right-handed and is defined as follows:
|
|
239
|
+
// x axis is pointing right
|
|
240
|
+
// y axis is pointing up
|
|
241
|
+
// z axis is pointing towards the viewer
|
|
242
|
+
// The z component of rotation is not used when calling this method.
|
|
237
243
|
rpc rotateVirtualSceneCamera(RotationRadian)
|
|
238
244
|
returns (google.protobuf.Empty) {}
|
|
239
|
-
// Velocity is absolute
|
|
245
|
+
// Velocity is absolute and is measured in meters per second.
|
|
246
|
+
// The coordinate system is right-handed and is defined as follows:
|
|
247
|
+
// x axis is pointing right
|
|
248
|
+
// y axis is pointing up
|
|
249
|
+
// z axis is pointing towards the viewer
|
|
240
250
|
rpc setVirtualSceneCameraVelocity(Velocity)
|
|
241
251
|
returns (google.protobuf.Empty) {}
|
|
242
252
|
// Set foldable posture
|
|
@@ -262,6 +272,16 @@ service EmulatorController {
|
|
|
262
272
|
// is not resizable. The following gRPC error codes can be returned:
|
|
263
273
|
// - FAILED_PRECONDITION (code 9) if the AVD is not resizable.
|
|
264
274
|
rpc setDisplayMode(DisplayMode) returns (google.protobuf.Empty) {}
|
|
275
|
+
|
|
276
|
+
// Changes the XR-related settings. Fails if the AVD is not XR. The
|
|
277
|
+
// following gRPC error codes can be returned:
|
|
278
|
+
// - FAILED_PRECONDITION (code 9) if the AVD is not XR.
|
|
279
|
+
rpc setXrOptions(XrOptions) returns (google.protobuf.Empty) {}
|
|
280
|
+
|
|
281
|
+
// Gets the current state of XR-related settings. Fails if the AVD is not
|
|
282
|
+
// XR. The following gRPC error codes can be returned:
|
|
283
|
+
// - FAILED_PRECONDITION (code 9) if the AVD is not XR.
|
|
284
|
+
rpc getXrOptions(google.protobuf.Empty) returns (XrOptions) {}
|
|
265
285
|
}
|
|
266
286
|
|
|
267
287
|
// A Run State that describes the state of the Virtual Machine.
|
|
@@ -297,6 +317,12 @@ message VmRunState {
|
|
|
297
317
|
// Guest experienced some error state, you cannot transition to this
|
|
298
318
|
// state.
|
|
299
319
|
INTERNAL_ERROR = 10;
|
|
320
|
+
// Completely restart the emulator.
|
|
321
|
+
RESTART = 11;
|
|
322
|
+
// Resume a stopped emulator
|
|
323
|
+
START = 12;
|
|
324
|
+
// Stop (pause) a running emulator
|
|
325
|
+
STOP = 13;
|
|
300
326
|
}
|
|
301
327
|
|
|
302
328
|
RunState state = 1;
|
|
@@ -470,6 +496,26 @@ message DisplayMode {
|
|
|
470
496
|
DisplayModeValue value = 1;
|
|
471
497
|
}
|
|
472
498
|
|
|
499
|
+
message XrOptions {
|
|
500
|
+
enum Environment {
|
|
501
|
+
LIVING_ROOM_DAY = 0;
|
|
502
|
+
LIVING_ROOM_NIGHT = 1;
|
|
503
|
+
// More environments may be added later.
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// The currently active artificial surrounding environment (a.k.a.
|
|
507
|
+
// passthrough environment).
|
|
508
|
+
Environment environment = 1;
|
|
509
|
+
|
|
510
|
+
// A value of 0.0 means that the real or artificial surrounding environment
|
|
511
|
+
// (a.k.a. passthrough environment) is not visible. A value of 1.0 means
|
|
512
|
+
// that the passthrough environment is fully visible. Any value outside of
|
|
513
|
+
// the range [0.0-1.0] is ignored and leaves the state of passthrough
|
|
514
|
+
// unchanged. For simplicity of the implementation, this number may be
|
|
515
|
+
// rounded to an integer before applying.
|
|
516
|
+
float passthrough_coefficient = 2;
|
|
517
|
+
}
|
|
518
|
+
|
|
473
519
|
message LogMessage {
|
|
474
520
|
// [Output Only] The contents of the log output.
|
|
475
521
|
string contents = 1;
|
|
@@ -477,11 +523,11 @@ message LogMessage {
|
|
|
477
523
|
// should match the start parameter sent with the request. If the serial
|
|
478
524
|
// console output exceeds the size of the buffer, older output will be
|
|
479
525
|
// overwritten by newer content and the start values will be mismatched.
|
|
480
|
-
int64 start = 2;
|
|
526
|
+
int64 start = 2 [deprecated = true];
|
|
481
527
|
//[Output Only] The position of the next byte of content from the serial
|
|
482
528
|
// console output. Use this value in the next request as the start
|
|
483
529
|
// parameter.
|
|
484
|
-
int64 next = 3;
|
|
530
|
+
int64 next = 3 [deprecated = true];
|
|
485
531
|
|
|
486
532
|
// Set the sort of response you are interested it in.
|
|
487
533
|
// It the type is "Parsed" the entries field will contain the parsed
|
|
@@ -628,6 +674,21 @@ message Touch {
|
|
|
628
674
|
}
|
|
629
675
|
|
|
630
676
|
EventExpiration expiration = 7;
|
|
677
|
+
|
|
678
|
+
// The orientation of the contact, if any.
|
|
679
|
+
int32 orientation = 8;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// A Pen is similar to a touch, with the addition
|
|
683
|
+
// of button and rubber information.
|
|
684
|
+
message Pen {
|
|
685
|
+
Touch location = 1;
|
|
686
|
+
|
|
687
|
+
// True if the button is pressed or not
|
|
688
|
+
bool button_pressed = 2;
|
|
689
|
+
|
|
690
|
+
// True if it is a rubber pointer.
|
|
691
|
+
bool rubber_pointer = 3;
|
|
631
692
|
}
|
|
632
693
|
|
|
633
694
|
// A TouchEvent contains a list of Touch objects that are in contact with
|
|
@@ -643,9 +704,15 @@ message TouchEvent {
|
|
|
643
704
|
|
|
644
705
|
// The display device where the touch event occurred.
|
|
645
706
|
// Omitting or using the value 0 indicates the main display.
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
707
|
+
int32 display = 2;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
message PenEvent {
|
|
711
|
+
// The list of Pen objects, note that these do not need to be unique
|
|
712
|
+
repeated Pen events = 1;
|
|
713
|
+
|
|
714
|
+
// The display device where the pen event occurred.
|
|
715
|
+
// Omitting or using the value 0 indicates the main display.
|
|
649
716
|
int32 display = 2;
|
|
650
717
|
}
|
|
651
718
|
|
|
@@ -653,11 +720,11 @@ message TouchEvent {
|
|
|
653
720
|
// interacting with a pointing device (such as a mouse).
|
|
654
721
|
message MouseEvent {
|
|
655
722
|
// The horizontal coordinate. This is the physical location on the
|
|
656
|
-
// screen
|
|
723
|
+
// screen, where 0 indicates the leftmost coordinate.
|
|
657
724
|
int32 x = 1;
|
|
658
725
|
|
|
659
|
-
// The vertical coordinate. This is the physical location on the screen
|
|
660
|
-
//
|
|
726
|
+
// The vertical coordinate. This is the physical location on the screen,
|
|
727
|
+
// where 0 indicates the topmost coordinate.
|
|
661
728
|
int32 y = 2;
|
|
662
729
|
|
|
663
730
|
// Indicates which buttons are pressed.
|
|
@@ -783,15 +850,57 @@ message KeyboardEvent {
|
|
|
783
850
|
string text = 5;
|
|
784
851
|
}
|
|
785
852
|
|
|
853
|
+
message XrCommand {
|
|
854
|
+
enum Action {
|
|
855
|
+
// Recenter the viewport position and rotation.
|
|
856
|
+
RECENTER = 0;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
Action action = 1;
|
|
860
|
+
}
|
|
861
|
+
|
|
786
862
|
// An input event that can be delivered to the emulator.
|
|
787
863
|
message InputEvent {
|
|
788
864
|
oneof type {
|
|
789
865
|
KeyboardEvent key_event = 1;
|
|
790
866
|
TouchEvent touch_event = 2;
|
|
791
867
|
MouseEvent mouse_event = 3;
|
|
868
|
+
AndroidEvent android_event = 4;
|
|
869
|
+
PenEvent pen_event = 5;
|
|
870
|
+
WheelEvent wheel_event = 6;
|
|
871
|
+
MouseEvent xr_hand_event = 7;
|
|
872
|
+
MouseEvent xr_eye_event = 8;
|
|
873
|
+
XrCommand xr_command = 9;
|
|
874
|
+
RotationRadian xr_head_rotation_event = 10;
|
|
875
|
+
Translation xr_head_movement_event = 11;
|
|
876
|
+
AngularVelocity xr_head_angular_velocity_event = 12;
|
|
877
|
+
Velocity xr_head_velocity_event = 13;
|
|
792
878
|
}
|
|
793
879
|
};
|
|
794
880
|
|
|
881
|
+
// The android input event system is a framework for handling input from a
|
|
882
|
+
// variety of devices by generating events that describe changes in the
|
|
883
|
+
// state of the devices and forwarding them to user space applications.
|
|
884
|
+
//
|
|
885
|
+
// An AndroidEvents will be delivered directly to the kernel as is.
|
|
886
|
+
message AndroidEvent {
|
|
887
|
+
// The type of the event. The types of the event are specified
|
|
888
|
+
// by the android kernel. Some examples are:
|
|
889
|
+
// EV_SYN, EV_KEY, EV_SW, etc..
|
|
890
|
+
// The exact definitions can be found in the input.h header file.
|
|
891
|
+
int32 type = 1;
|
|
892
|
+
|
|
893
|
+
// The actual code to be send to the kernel. The actual meaning
|
|
894
|
+
// of the code depends on the type definition.
|
|
895
|
+
int32 code = 2;
|
|
896
|
+
|
|
897
|
+
// The actual value of the event.
|
|
898
|
+
int32 value = 3;
|
|
899
|
+
|
|
900
|
+
// The display id associated with this input event.
|
|
901
|
+
int32 display = 4;
|
|
902
|
+
};
|
|
903
|
+
|
|
795
904
|
message Fingerprint {
|
|
796
905
|
// True when the fingprint is touched.
|
|
797
906
|
bool isTouching = 1;
|
|
@@ -1054,6 +1163,17 @@ message EmulatorStatus {
|
|
|
1054
1163
|
// The hardware configuration of the running emulator as
|
|
1055
1164
|
// key valure pairs.
|
|
1056
1165
|
EntryList hardwareConfig = 5;
|
|
1166
|
+
|
|
1167
|
+
// Some guests will produce a heart beat, that can be used to
|
|
1168
|
+
// detect if the guest is active.
|
|
1169
|
+
// This is a monotonically increasing number that gets incremented
|
|
1170
|
+
// around once a second.
|
|
1171
|
+
uint64 heartbeat = 6;
|
|
1172
|
+
|
|
1173
|
+
// The configuration of services in the guest, this map
|
|
1174
|
+
// contains key value pairs that are specific to the image
|
|
1175
|
+
// used by the guest.
|
|
1176
|
+
map<string, string> guestConfig = 7;
|
|
1057
1177
|
}
|
|
1058
1178
|
|
|
1059
1179
|
message AudioFormat {
|
|
@@ -1258,11 +1378,17 @@ message Notification {
|
|
|
1258
1378
|
DisplayConfigurationsChangedNotification
|
|
1259
1379
|
displayConfigurationsChangedNotification = 3;
|
|
1260
1380
|
Posture posture = 4;
|
|
1261
|
-
|
|
1381
|
+
BootCompletedNotification booted = 5;
|
|
1382
|
+
BrightnessValue brightness = 6;
|
|
1383
|
+
|
|
1384
|
+
// This notification is sent when a TextView receives or loses focus.
|
|
1385
|
+
// It is also sent immediately in response to the streamNotification
|
|
1386
|
+
// call.
|
|
1387
|
+
TextViewFocus textViewFocus = 7;
|
|
1262
1388
|
}
|
|
1263
1389
|
}
|
|
1264
1390
|
|
|
1265
|
-
message
|
|
1391
|
+
message BootCompletedNotification {
|
|
1266
1392
|
// The time in milliseconds it took for the boot to complete.
|
|
1267
1393
|
// Note that this value can be 0 when you are loading from a snapshot.
|
|
1268
1394
|
int32 time = 1;
|
|
@@ -1277,6 +1403,15 @@ message CameraNotification {
|
|
|
1277
1403
|
int32 display = 2;
|
|
1278
1404
|
}
|
|
1279
1405
|
|
|
1406
|
+
message TextViewFocus {
|
|
1407
|
+
// Indicates whether a text view currently has focus.
|
|
1408
|
+
bool textViewHasFocus = 1;
|
|
1409
|
+
|
|
1410
|
+
// If a text view has focus, the display where the text view is located.
|
|
1411
|
+
// Otherwise, unset.
|
|
1412
|
+
int32 display = 2;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1280
1415
|
// Fired when an update to a display event has been fired through the extended
|
|
1281
1416
|
// ui. This does not fire events when the display is changed through the console
|
|
1282
1417
|
// or the gRPC endpoint.
|
|
@@ -1285,16 +1420,36 @@ message DisplayConfigurationsChangedNotification {
|
|
|
1285
1420
|
}
|
|
1286
1421
|
|
|
1287
1422
|
message RotationRadian {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
float
|
|
1291
|
-
|
|
1423
|
+
// Components of the rotation vector in radians.
|
|
1424
|
+
// Rotation angles are relative to the current orientation.
|
|
1425
|
+
float x = 1; // Angle of rotation around the x axis in right-handed direction.
|
|
1426
|
+
float y = 2; // Angle of rotation around the y axis in right-handed direction.
|
|
1427
|
+
float z = 3; // Angle of rotation around the z axis in right-handed direction.
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
message Translation {
|
|
1431
|
+
// Components of the translation vector in meters.
|
|
1432
|
+
float delta_x = 1;
|
|
1433
|
+
float delta_y = 2;
|
|
1434
|
+
float delta_z = 3;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
message AngularVelocity {
|
|
1438
|
+
// Components of the target angular velocity vector in radians per second.
|
|
1439
|
+
// Transition to these values is implementation dependent, and may be
|
|
1440
|
+
// smoothed over time.
|
|
1441
|
+
float omega_x = 1;
|
|
1442
|
+
float omega_y = 2;
|
|
1443
|
+
float omega_z = 3;
|
|
1292
1444
|
}
|
|
1293
1445
|
|
|
1294
1446
|
message Velocity {
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1447
|
+
// Components of the target velocity vector in meters per second.
|
|
1448
|
+
// Transition to these values is implementation dependent, and may be
|
|
1449
|
+
// smoothed over time.
|
|
1450
|
+
float x = 1;
|
|
1451
|
+
float y = 2;
|
|
1452
|
+
float z = 3;
|
|
1298
1453
|
}
|
|
1299
1454
|
|
|
1300
1455
|
// Must follow the definition in "external/qemu/android/hw-sensors.h"
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Copyright 2020 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
option java_multiple_files = true;
|
|
18
|
+
option java_package = "com.android.emulator.control";
|
|
19
|
+
option objc_class_prefix = "AEC";
|
|
20
|
+
|
|
21
|
+
package android.emulation.control;
|
|
22
|
+
import "google/protobuf/empty.proto";
|
|
23
|
+
|
|
24
|
+
service UiController {
|
|
25
|
+
// PaneEntry specifies which pane will be selected when
|
|
26
|
+
// the extended control is shown. If the extended is visible already,
|
|
27
|
+
// this method will set visibilityChangedto to false.
|
|
28
|
+
rpc showExtendedControls(PaneEntry) returns (ExtendedControlsStatus) {}
|
|
29
|
+
// this method has no effect if the extended controls are hidden.
|
|
30
|
+
// In that case, visibilityChanged will be set to false;
|
|
31
|
+
rpc closeExtendedControls(google.protobuf.Empty)
|
|
32
|
+
returns (ExtendedControlsStatus) {}
|
|
33
|
+
rpc setUiTheme(ThemingStyle) returns (google.protobuf.Empty) {}
|
|
34
|
+
|
|
35
|
+
// Returns the user configuration of the running emulator. The user
|
|
36
|
+
// configuration contains information about the user interface.
|
|
37
|
+
rpc getUserConfig(google.protobuf.Empty) returns (UserConfig) {}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message UserConfigEntry {
|
|
41
|
+
string key = 1;
|
|
42
|
+
string value = 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The user configuration of the running emulator as
|
|
46
|
+
// key value pairs. This contains the data you normally find
|
|
47
|
+
// in emulator-user.ini
|
|
48
|
+
message UserConfig {
|
|
49
|
+
repeated UserConfigEntry entries = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message ThemingStyle {
|
|
53
|
+
enum Style {
|
|
54
|
+
LIGHT = 0;
|
|
55
|
+
DARK = 1;
|
|
56
|
+
CONTRAST = 2;
|
|
57
|
+
}
|
|
58
|
+
Style style = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message ExtendedControlsStatus {
|
|
62
|
+
bool visibilityChanged = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// The pixel coordinates are resolution independent, meaning the coordinates
|
|
66
|
+
// are independent from the pixel grid, resulting in a graphical user
|
|
67
|
+
// interface that is displayed at a consistent location, regardless of the
|
|
68
|
+
// resolution of the screen.
|
|
69
|
+
//
|
|
70
|
+
// For technical details: https://doc.qt.io/qt-5/highdpi.html
|
|
71
|
+
//
|
|
72
|
+
// Some things to note:
|
|
73
|
+
//
|
|
74
|
+
// - You cannot move a window offscreen.
|
|
75
|
+
// - There is a padding of around 10px around the frame.
|
|
76
|
+
//
|
|
77
|
+
// This means that moving to (0, 0) or (10, 10) will have the same result.
|
|
78
|
+
// This means that anchoring might not exactly behave as requested.
|
|
79
|
+
message WindowPosition {
|
|
80
|
+
// Anchor that is used to determine horizontal window placement.
|
|
81
|
+
enum HorizontalAnchor {
|
|
82
|
+
LEFT = 0; // The x coordinate will be treated as the left edge of the
|
|
83
|
+
// window.
|
|
84
|
+
HCENTER = 1; // The x coordinate will be treated as the middle between
|
|
85
|
+
// the left and right edges of the window.
|
|
86
|
+
RIGHT = 2; // The x coordinate will be treated as the right edge of
|
|
87
|
+
// the window.
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Anchor that is used to determine vertical window placement.
|
|
91
|
+
enum VerticalAnchor {
|
|
92
|
+
TOP = 0; // The y coordinate will be treated as the top edge of the
|
|
93
|
+
// window.
|
|
94
|
+
VCENTER = 1; // The y coordinate will be treated as the middle between
|
|
95
|
+
// the top and bottom edges of the window.
|
|
96
|
+
BOTTOM = 3; // The y coordinate will be treated as the bottom edge of
|
|
97
|
+
// the window.
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Corresponds to the x and y coordinate of the window geometry. The window
|
|
101
|
+
// geometry includes the window frame.
|
|
102
|
+
// See: https://doc.qt.io/qt-5/application-windows.html#window-geometry for
|
|
103
|
+
// details and pecularities on linux.
|
|
104
|
+
uint32 x = 1;
|
|
105
|
+
uint32 y = 2;
|
|
106
|
+
|
|
107
|
+
HorizontalAnchor horizontalAnchor = 3;
|
|
108
|
+
VerticalAnchor verticalAnchor = 4;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message PaneEntry {
|
|
112
|
+
enum PaneIndex {
|
|
113
|
+
// When specified as KEEP_CURRENT, extended controls will display the
|
|
114
|
+
// current pane.
|
|
115
|
+
// If it is the first time for extended controls to be shown, LOCATION
|
|
116
|
+
// will be used.
|
|
117
|
+
KEEP_CURRENT = 0;
|
|
118
|
+
// Referenced from
|
|
119
|
+
// external/qemu/android/android-emu/android/skin/qt/extended-window-styles.h
|
|
120
|
+
LOCATION = 1;
|
|
121
|
+
MULTIDISPLAY = 2;
|
|
122
|
+
CELLULAR = 3;
|
|
123
|
+
BATTERY = 4;
|
|
124
|
+
CAMERA = 5;
|
|
125
|
+
TELEPHONE = 6;
|
|
126
|
+
DPAD = 7;
|
|
127
|
+
TV_REMOTE = 8;
|
|
128
|
+
ROTARY = 9;
|
|
129
|
+
MICROPHONE = 10;
|
|
130
|
+
FINGER = 11;
|
|
131
|
+
VIRT_SENSORS = 12;
|
|
132
|
+
SNAPSHOT = 13;
|
|
133
|
+
BUGREPORT = 14;
|
|
134
|
+
RECORD = 15;
|
|
135
|
+
GOOGLE_PLAY = 16;
|
|
136
|
+
SETTINGS = 17;
|
|
137
|
+
HELP = 18;
|
|
138
|
+
CAR = 19;
|
|
139
|
+
CAR_ROTARY = 20;
|
|
140
|
+
SENSOR_REPLAY = 21;
|
|
141
|
+
};
|
|
142
|
+
PaneIndex index = 1;
|
|
143
|
+
|
|
144
|
+
// Set the window position to the specified coordinates if no coordinates are
|
|
145
|
+
// present in the AVD, otherwise this value will be igonred.
|
|
146
|
+
WindowPosition position = 2;
|
|
147
|
+
}
|
package/lib/vvd/grpc/index.d.ts
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
import { Readable } from 'stream';
|
|
2
|
-
import { MouseEvent } from './types/MouseEvent';
|
|
3
|
-
import { GrpcKeyboardEvent } from './types/KeyEvent';
|
|
4
2
|
import { GrpcClient } from './types/GrpcClient';
|
|
5
3
|
import { EmulatorConfig } from '../../emulatorutil/running';
|
|
6
4
|
import { Metadata } from '@grpc/grpc-js';
|
|
7
|
-
|
|
5
|
+
import { ImageFormat, KeyboardEvent, LogMessage, MouseEvent, SensorValue } from './types/proto-types';
|
|
6
|
+
import { UiControllerClient } from './types/UiControllerClient';
|
|
7
|
+
export declare const AuthorizationKey = "Authorization";
|
|
8
|
+
export declare class GrpcEmulator {
|
|
8
9
|
eConf: EmulatorConfig;
|
|
9
|
-
protoPath: string;
|
|
10
|
+
protoPath: string[];
|
|
11
|
+
ip: string;
|
|
10
12
|
client: GrpcClient;
|
|
13
|
+
uiClient: UiControllerClient;
|
|
11
14
|
connected: boolean;
|
|
12
15
|
token: string;
|
|
13
16
|
authMate: Metadata;
|
|
14
17
|
deadline: Date;
|
|
15
18
|
controller: any;
|
|
16
19
|
screenshotStream?: Readable;
|
|
17
|
-
|
|
20
|
+
logcatStream?: Readable;
|
|
21
|
+
constructor(eConf: EmulatorConfig, protoPath: string[], ip?: string);
|
|
18
22
|
close(): void;
|
|
19
23
|
getAuthMeta(): Metadata;
|
|
20
24
|
waitForReady(): Promise<boolean>;
|
|
21
|
-
|
|
25
|
+
streamScreenshot(imageFormat?: ImageFormat): Promise<Readable>;
|
|
22
26
|
getScreenshot(): Promise<Buffer>;
|
|
23
27
|
getStatus(): Promise<unknown>;
|
|
24
28
|
sendMouse(message: MouseEvent): void;
|
|
25
|
-
sendKey(data:
|
|
29
|
+
sendKey(data: KeyboardEvent): void;
|
|
30
|
+
showExtendedControls(paneIndex?: number): Promise<unknown>;
|
|
31
|
+
closeExtendedControls(): Promise<unknown>;
|
|
32
|
+
setSensor(sensorValue: SensorValue): Promise<unknown>;
|
|
33
|
+
getSensor(sensorValue: SensorValue): Promise<unknown>;
|
|
34
|
+
streamLogcat(params?: LogMessage): Promise<Readable>;
|
|
26
35
|
}
|
|
27
36
|
export declare function createGrpcClient(eConf: EmulatorConfig): GrpcEmulator;
|
package/lib/vvd/grpc/index.js
CHANGED
|
@@ -3,18 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.GrpcEmulator = exports.AuthorizationKey = void 0;
|
|
6
7
|
exports.createGrpcClient = createGrpcClient;
|
|
7
|
-
exports.default = void 0;
|
|
8
8
|
var _path = _interopRequireDefault(require("path"));
|
|
9
9
|
var _protoLoader = require("@grpc/proto-loader");
|
|
10
10
|
var _grpcError = require("./grpcError");
|
|
11
11
|
var _grpcJs = require("@grpc/grpc-js");
|
|
12
|
+
var _protoTypes = require("./types/proto-types");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const AuthorizationKey = exports.AuthorizationKey = 'Authorization';
|
|
13
15
|
class GrpcEmulator {
|
|
14
16
|
connected = false;
|
|
15
17
|
constructor(eConf, protoPath) {
|
|
18
|
+
let ip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '127.0.0.1';
|
|
16
19
|
this.eConf = eConf;
|
|
17
20
|
this.protoPath = protoPath;
|
|
21
|
+
this.ip = ip;
|
|
18
22
|
this.token = eConf['grpc.token'];
|
|
19
23
|
const packageDefinition = (0, _protoLoader.loadSync)(this.protoPath, {
|
|
20
24
|
keepCase: true,
|
|
@@ -27,18 +31,23 @@ class GrpcEmulator {
|
|
|
27
31
|
this.deadline.setMinutes(this.deadline.getMinutes() + 2);
|
|
28
32
|
this.controller = (0, _grpcJs.loadPackageDefinition)(packageDefinition).android.emulation.control;
|
|
29
33
|
const mateInfo = new _grpcJs.Metadata();
|
|
30
|
-
mateInfo.set(
|
|
34
|
+
mateInfo.set(AuthorizationKey, `Bearer ${this.token}`);
|
|
31
35
|
this.authMate = mateInfo;
|
|
32
|
-
this.client = new this.controller.EmulatorController(
|
|
36
|
+
this.client = new this.controller.EmulatorController(`${this.ip}:${eConf['grpc.port']}`, _grpcJs.credentials.createInsecure(), {
|
|
37
|
+
'grpc.max_receive_message_length': 32 * 1024 * 1024,
|
|
38
|
+
// 32MB
|
|
39
|
+
'grpc.max_send_message_length': 32 * 1024 * 1024 // 32MB
|
|
40
|
+
});
|
|
41
|
+
this.uiClient = new this.controller.UiController(`127.0.0.1:${eConf['grpc.port']}`, _grpcJs.credentials.createInsecure());
|
|
33
42
|
}
|
|
34
43
|
close() {
|
|
44
|
+
this.screenshotStream?.destroy();
|
|
45
|
+
this.logcatStream?.destroy();
|
|
46
|
+
this.client.getChannel().close();
|
|
35
47
|
this.client.close();
|
|
36
48
|
}
|
|
37
49
|
getAuthMeta() {
|
|
38
|
-
|
|
39
|
-
const mateInfo = new _grpcJs.Metadata();
|
|
40
|
-
mateInfo.set('Authorization', `Bearer ${token}`);
|
|
41
|
-
return mateInfo;
|
|
50
|
+
return this.authMate;
|
|
42
51
|
}
|
|
43
52
|
waitForReady() {
|
|
44
53
|
if (this.connected) {
|
|
@@ -56,18 +65,21 @@ class GrpcEmulator {
|
|
|
56
65
|
});
|
|
57
66
|
});
|
|
58
67
|
}
|
|
59
|
-
async
|
|
68
|
+
async streamScreenshot(imageFormat) {
|
|
60
69
|
await this.waitForReady();
|
|
61
70
|
if (this.screenshotStream) {
|
|
62
71
|
this.screenshotStream.destroy();
|
|
63
72
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
const params = imageFormat || {
|
|
74
|
+
format: _protoTypes.ImageFormatType.PNG
|
|
75
|
+
};
|
|
76
|
+
this.screenshotStream = this.client.streamScreenshot(params, this.authMate);
|
|
77
|
+
// don't delete it, otherwise crash process when emulator exit
|
|
78
|
+
this.screenshotStream.on('error', () => {
|
|
79
|
+
// TODO: not care at now
|
|
80
|
+
// console.error('streamScreenshot error:', err)
|
|
70
81
|
});
|
|
82
|
+
return this.screenshotStream;
|
|
71
83
|
}
|
|
72
84
|
getScreenshot() {
|
|
73
85
|
return new Promise((resolve, reject) => {
|
|
@@ -109,9 +121,60 @@ class GrpcEmulator {
|
|
|
109
121
|
if (err) console.error(err);
|
|
110
122
|
});
|
|
111
123
|
}
|
|
124
|
+
showExtendedControls() {
|
|
125
|
+
let paneIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
126
|
+
if (!this.uiClient) return Promise.reject('UiController not available');
|
|
127
|
+
return new Promise((resolve, reject) => {
|
|
128
|
+
this.uiClient.showExtendedControls({
|
|
129
|
+
index: paneIndex
|
|
130
|
+
}, this.authMate, (err, response) => {
|
|
131
|
+
if (err) return reject(err);
|
|
132
|
+
resolve(response);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
closeExtendedControls() {
|
|
137
|
+
if (!this.uiClient) return Promise.reject('UiController not available');
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
this.uiClient.closeExtendedControls({}, this.authMate, (err, response) => {
|
|
140
|
+
if (err) return reject(err);
|
|
141
|
+
resolve(response);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
setSensor(sensorValue) {
|
|
146
|
+
if (!this.client) return Promise.reject('grpc client not available');
|
|
147
|
+
return new Promise((resolve, reject) => {
|
|
148
|
+
this.client.setSensor(sensorValue, this.authMate, (err, response) => {
|
|
149
|
+
if (err) return reject(err);
|
|
150
|
+
resolve(response);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
getSensor(sensorValue) {
|
|
155
|
+
if (!this.client) return Promise.reject('grpc client not available');
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
this.client.getSensor(sensorValue, this.authMate, (err, response) => {
|
|
158
|
+
if (err) return reject(err);
|
|
159
|
+
resolve(response);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
async streamLogcat(params) {
|
|
164
|
+
await this.waitForReady();
|
|
165
|
+
if (this.logcatStream) {
|
|
166
|
+
this.logcatStream.destroy();
|
|
167
|
+
}
|
|
168
|
+
const logMessage = params || {};
|
|
169
|
+
this.logcatStream = this.client.streamLogcat(logMessage, this.authMate);
|
|
170
|
+
this.logcatStream.on('error', err => {
|
|
171
|
+
console.error('streamLogcat error:', err?.message || err);
|
|
172
|
+
});
|
|
173
|
+
return this.logcatStream;
|
|
174
|
+
}
|
|
112
175
|
}
|
|
113
|
-
exports.
|
|
176
|
+
exports.GrpcEmulator = GrpcEmulator;
|
|
114
177
|
function createGrpcClient(eConf) {
|
|
115
|
-
const protoPath = _path.default.
|
|
178
|
+
const protoPath = [_path.default.resolve(__dirname, '../../static/proto/emulator_controller.proto'), _path.default.resolve(__dirname, '../../static/proto/ui_controller_service.proto')];
|
|
116
179
|
return new GrpcEmulator(eConf, protoPath);
|
|
117
180
|
}
|
|
@@ -1,4 +1,45 @@
|
|
|
1
|
-
import { Client } from '@grpc/grpc-js';
|
|
1
|
+
import { Client, Metadata, ServiceError, ClientUnaryCall } from '@grpc/grpc-js';
|
|
2
|
+
import type { PhysicalModelValue, ClipData, BatteryState, GpsState, Fingerprint, TouchEvent, PhoneCall, PhoneResponse, SmsMessage, PhoneNumber, EmulatorStatus, ImageFormat, Image, AudioFormat, LogMessage, VmRunState, DisplayConfigurations, BrightnessValue, DisplayMode, RotationRadian, Velocity, Posture, SensorValue, KeyboardEvent, MouseEvent } from './proto-types';
|
|
2
3
|
export interface GrpcClient extends Client {
|
|
3
|
-
|
|
4
|
+
setSensor(request: SensorValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
5
|
+
getSensor(request: SensorValue, metadata: Metadata, callback: (error: ServiceError | null, response: SensorValue) => void): ClientUnaryCall;
|
|
6
|
+
streamSensor(request: SensorValue, metadata: Metadata): NodeJS.ReadStream;
|
|
7
|
+
setPhysicalModel(request: PhysicalModelValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
8
|
+
getPhysicalModel(request: PhysicalModelValue, metadata: Metadata, callback: (error: ServiceError | null, response: PhysicalModelValue) => void): ClientUnaryCall;
|
|
9
|
+
streamPhysicalModel(request: PhysicalModelValue, metadata: Metadata): NodeJS.ReadStream;
|
|
10
|
+
setClipboard(request: ClipData, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
11
|
+
getClipboard(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: ClipData) => void): ClientUnaryCall;
|
|
12
|
+
streamClipboard(request: {}, metadata: Metadata): NodeJS.ReadStream;
|
|
13
|
+
setBattery(request: BatteryState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
14
|
+
getBattery(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: BatteryState) => void): ClientUnaryCall;
|
|
15
|
+
setGps(request: GpsState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
16
|
+
getGps(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: GpsState) => void): ClientUnaryCall;
|
|
17
|
+
sendFingerprint(request: Fingerprint, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
18
|
+
sendKey(request: KeyboardEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
19
|
+
sendTouch(request: TouchEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
20
|
+
sendMouse(request: MouseEvent, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
21
|
+
injectWheel(metadata: Metadata): NodeJS.WritableStream;
|
|
22
|
+
streamInputEvent(metadata: Metadata): NodeJS.WritableStream;
|
|
23
|
+
sendPhone(request: PhoneCall, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
|
|
24
|
+
sendSms(request: SmsMessage, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
|
|
25
|
+
setPhoneNumber(request: PhoneNumber, metadata: Metadata, callback: (error: ServiceError | null, response: PhoneResponse) => void): ClientUnaryCall;
|
|
26
|
+
getStatus(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: EmulatorStatus) => void): ClientUnaryCall;
|
|
27
|
+
getScreenshot(request: ImageFormat, metadata: Metadata, callback: (error: ServiceError | null, response: Image) => void): ClientUnaryCall;
|
|
28
|
+
streamScreenshot(request: ImageFormat, metadata: Metadata): NodeJS.ReadStream;
|
|
29
|
+
streamAudio(request: AudioFormat, metadata: Metadata): NodeJS.ReadStream;
|
|
30
|
+
injectAudio(metadata: Metadata): NodeJS.WritableStream;
|
|
31
|
+
getLogcat(request: LogMessage, metadata: Metadata, callback: (error: ServiceError | null, response: LogMessage) => void): ClientUnaryCall;
|
|
32
|
+
streamLogcat(request: LogMessage, metadata: Metadata): NodeJS.ReadStream;
|
|
33
|
+
setVmState(request: VmRunState, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
34
|
+
getVmState(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: VmRunState) => void): ClientUnaryCall;
|
|
35
|
+
setDisplayConfigurations(request: DisplayConfigurations, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayConfigurations) => void): ClientUnaryCall;
|
|
36
|
+
getDisplayConfigurations(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayConfigurations) => void): ClientUnaryCall;
|
|
37
|
+
streamNotification(request: {}, metadata: Metadata): NodeJS.ReadStream;
|
|
38
|
+
getBrightness(request: BrightnessValue, metadata: Metadata, callback: (error: ServiceError | null, response: BrightnessValue) => void): ClientUnaryCall;
|
|
39
|
+
setBrightness(request: BrightnessValue, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
40
|
+
getDisplayMode(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: DisplayMode) => void): ClientUnaryCall;
|
|
41
|
+
setDisplayMode(request: DisplayMode, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
42
|
+
rotateVirtualSceneCamera(request: RotationRadian, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
43
|
+
setVirtualSceneCameraVelocity(request: Velocity, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
44
|
+
setPosture(request: Posture, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
4
45
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Metadata, ServiceError, ClientUnaryCall } from '@grpc/grpc-js';
|
|
2
|
+
export interface PaneEntry {
|
|
3
|
+
index: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ThemingStyle {
|
|
6
|
+
style: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtendedControlsStatus {
|
|
9
|
+
visibilityChanged: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface UserConfigEntry {
|
|
12
|
+
key: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UserConfig {
|
|
16
|
+
entries: UserConfigEntry[];
|
|
17
|
+
}
|
|
18
|
+
export interface UiControllerClient {
|
|
19
|
+
showExtendedControls(request: PaneEntry, metadata: Metadata, callback: (error: ServiceError | null, response: ExtendedControlsStatus) => void): ClientUnaryCall;
|
|
20
|
+
closeExtendedControls(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: ExtendedControlsStatus) => void): ClientUnaryCall;
|
|
21
|
+
setUiTheme(request: ThemingStyle, metadata: Metadata, callback: (error: ServiceError | null, response: {}) => void): ClientUnaryCall;
|
|
22
|
+
getUserConfig(request: {}, metadata: Metadata, callback: (error: ServiceError | null, response: UserConfig) => void): ClientUnaryCall;
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _GrpcClient = require("./GrpcClient");
|
|
7
|
+
Object.keys(_GrpcClient).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _GrpcClient[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _GrpcClient[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _protoTypes = require("./proto-types");
|
|
18
|
+
Object.keys(_protoTypes).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _protoTypes[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _protoTypes[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _UiControllerClient = require("./UiControllerClient");
|
|
29
|
+
Object.keys(_UiControllerClient).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _UiControllerClient[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _UiControllerClient[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export interface PhysicalModelValue {
|
|
2
|
+
target: number;
|
|
3
|
+
status?: number;
|
|
4
|
+
value?: {
|
|
5
|
+
data: number[];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface ClipData {
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BatteryState {
|
|
12
|
+
hasBattery: boolean;
|
|
13
|
+
isPresent: boolean;
|
|
14
|
+
charger: number;
|
|
15
|
+
chargeLevel: number;
|
|
16
|
+
health: number;
|
|
17
|
+
status: number;
|
|
18
|
+
}
|
|
19
|
+
export interface GpsState {
|
|
20
|
+
passiveUpdate: boolean;
|
|
21
|
+
latitude: number;
|
|
22
|
+
longitude: number;
|
|
23
|
+
speed?: number;
|
|
24
|
+
bearing?: number;
|
|
25
|
+
altitude?: number;
|
|
26
|
+
satellites?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface Fingerprint {
|
|
29
|
+
isTouching: boolean;
|
|
30
|
+
touchId: number;
|
|
31
|
+
}
|
|
32
|
+
export interface TouchEvent {
|
|
33
|
+
touches: Array<{
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
identifier: number;
|
|
37
|
+
pressure: number;
|
|
38
|
+
touch_major?: number;
|
|
39
|
+
touch_minor?: number;
|
|
40
|
+
expiration?: number;
|
|
41
|
+
}>;
|
|
42
|
+
display?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface PhoneCall {
|
|
45
|
+
operation: number;
|
|
46
|
+
number: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PhoneResponse {
|
|
49
|
+
response: number;
|
|
50
|
+
}
|
|
51
|
+
export interface SmsMessage {
|
|
52
|
+
srcAddress: string;
|
|
53
|
+
text: string;
|
|
54
|
+
}
|
|
55
|
+
export interface PhoneNumber {
|
|
56
|
+
number: string;
|
|
57
|
+
}
|
|
58
|
+
export interface EmulatorStatus {
|
|
59
|
+
version: string;
|
|
60
|
+
uptime: number;
|
|
61
|
+
booted: boolean;
|
|
62
|
+
vmConfig: any;
|
|
63
|
+
hardwareConfig: Record<string, any>;
|
|
64
|
+
}
|
|
65
|
+
export interface ImageFormat {
|
|
66
|
+
format: number;
|
|
67
|
+
rotation?: any;
|
|
68
|
+
width?: number;
|
|
69
|
+
height?: number;
|
|
70
|
+
display?: number;
|
|
71
|
+
transport?: any;
|
|
72
|
+
}
|
|
73
|
+
export interface Image {
|
|
74
|
+
format: ImageFormat;
|
|
75
|
+
image: Buffer;
|
|
76
|
+
seq?: number;
|
|
77
|
+
timestampUs?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface AudioFormat {
|
|
80
|
+
samplingRate: number;
|
|
81
|
+
channels: number;
|
|
82
|
+
format: number;
|
|
83
|
+
mode?: number;
|
|
84
|
+
}
|
|
85
|
+
export interface LogMessage {
|
|
86
|
+
contents?: string;
|
|
87
|
+
start?: number;
|
|
88
|
+
next?: number;
|
|
89
|
+
sort?: number;
|
|
90
|
+
entries?: any[];
|
|
91
|
+
}
|
|
92
|
+
export interface VmRunState {
|
|
93
|
+
state: number;
|
|
94
|
+
}
|
|
95
|
+
export interface DisplayConfigurations {
|
|
96
|
+
displays: any[];
|
|
97
|
+
userConfigurable: number;
|
|
98
|
+
maxDisplays: number;
|
|
99
|
+
}
|
|
100
|
+
export interface BrightnessValue {
|
|
101
|
+
target: number;
|
|
102
|
+
value: number;
|
|
103
|
+
}
|
|
104
|
+
export interface DisplayMode {
|
|
105
|
+
value: number;
|
|
106
|
+
}
|
|
107
|
+
export interface RotationRadian {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
z: number;
|
|
111
|
+
}
|
|
112
|
+
export interface Velocity {
|
|
113
|
+
x: number;
|
|
114
|
+
y: number;
|
|
115
|
+
z: number;
|
|
116
|
+
}
|
|
117
|
+
export interface Posture {
|
|
118
|
+
value: number;
|
|
119
|
+
}
|
|
120
|
+
export interface SensorValue {
|
|
121
|
+
target: number;
|
|
122
|
+
status?: number;
|
|
123
|
+
value?: {
|
|
124
|
+
data: number[];
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface KeyboardEvent {
|
|
128
|
+
codeType?: number;
|
|
129
|
+
eventType?: number;
|
|
130
|
+
keyCode?: number | string;
|
|
131
|
+
key?: string;
|
|
132
|
+
text?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface MouseEvent {
|
|
135
|
+
x?: number;
|
|
136
|
+
y?: number;
|
|
137
|
+
buttons?: number;
|
|
138
|
+
display?: number;
|
|
139
|
+
}
|
|
140
|
+
export declare enum SensorType {
|
|
141
|
+
ACCELERATION = 0,
|
|
142
|
+
GYROSCOPE = 1,
|
|
143
|
+
MAGNETIC_FIELD = 2,
|
|
144
|
+
ORIENTATION = 3,
|
|
145
|
+
TEMPERATURE = 4,
|
|
146
|
+
PROXIMITY = 5,
|
|
147
|
+
LIGHT = 6,
|
|
148
|
+
PRESSURE = 7,
|
|
149
|
+
HUMIDITY = 8,
|
|
150
|
+
MAGNETIC_FIELD_UNCALIBRATED = 9,
|
|
151
|
+
GYROSCOPE_UNCALIBRATED = 10,
|
|
152
|
+
HEART_RATE = 14,
|
|
153
|
+
RGBC_LIGHT = 15,
|
|
154
|
+
ACCELERATION_UNCALIBRATED = 17
|
|
155
|
+
}
|
|
156
|
+
export declare enum SensorState {
|
|
157
|
+
OK = 0,
|
|
158
|
+
NO_SERVICE = -3,
|
|
159
|
+
DISABLED = -2,
|
|
160
|
+
UNKNOWN = -1
|
|
161
|
+
}
|
|
162
|
+
export declare enum KeyEventType {
|
|
163
|
+
KEYDOWN = 0,
|
|
164
|
+
KEYUP = 1,
|
|
165
|
+
KEYPRESS = 2
|
|
166
|
+
}
|
|
167
|
+
export declare enum KeyCodeType {
|
|
168
|
+
USB = 0,
|
|
169
|
+
EVDEV = 1,
|
|
170
|
+
XKB = 2,
|
|
171
|
+
WIN = 3,
|
|
172
|
+
MAC = 4
|
|
173
|
+
}
|
|
174
|
+
export declare enum ImageFormatType {
|
|
175
|
+
PNG = 0,
|
|
176
|
+
RGBA8888 = 1,
|
|
177
|
+
RGB888 = 2
|
|
178
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SensorType = exports.SensorState = exports.KeyEventType = exports.KeyCodeType = exports.ImageFormatType = void 0;
|
|
7
|
+
let SensorType = exports.SensorType = /*#__PURE__*/function (SensorType) {
|
|
8
|
+
SensorType[SensorType["ACCELERATION"] = 0] = "ACCELERATION";
|
|
9
|
+
SensorType[SensorType["GYROSCOPE"] = 1] = "GYROSCOPE";
|
|
10
|
+
SensorType[SensorType["MAGNETIC_FIELD"] = 2] = "MAGNETIC_FIELD";
|
|
11
|
+
SensorType[SensorType["ORIENTATION"] = 3] = "ORIENTATION";
|
|
12
|
+
SensorType[SensorType["TEMPERATURE"] = 4] = "TEMPERATURE";
|
|
13
|
+
SensorType[SensorType["PROXIMITY"] = 5] = "PROXIMITY";
|
|
14
|
+
SensorType[SensorType["LIGHT"] = 6] = "LIGHT";
|
|
15
|
+
SensorType[SensorType["PRESSURE"] = 7] = "PRESSURE";
|
|
16
|
+
SensorType[SensorType["HUMIDITY"] = 8] = "HUMIDITY";
|
|
17
|
+
SensorType[SensorType["MAGNETIC_FIELD_UNCALIBRATED"] = 9] = "MAGNETIC_FIELD_UNCALIBRATED";
|
|
18
|
+
SensorType[SensorType["GYROSCOPE_UNCALIBRATED"] = 10] = "GYROSCOPE_UNCALIBRATED";
|
|
19
|
+
SensorType[SensorType["HEART_RATE"] = 14] = "HEART_RATE";
|
|
20
|
+
SensorType[SensorType["RGBC_LIGHT"] = 15] = "RGBC_LIGHT";
|
|
21
|
+
SensorType[SensorType["ACCELERATION_UNCALIBRATED"] = 17] = "ACCELERATION_UNCALIBRATED";
|
|
22
|
+
return SensorType;
|
|
23
|
+
}({});
|
|
24
|
+
let SensorState = exports.SensorState = /*#__PURE__*/function (SensorState) {
|
|
25
|
+
SensorState[SensorState["OK"] = 0] = "OK";
|
|
26
|
+
SensorState[SensorState["NO_SERVICE"] = -3] = "NO_SERVICE";
|
|
27
|
+
SensorState[SensorState["DISABLED"] = -2] = "DISABLED";
|
|
28
|
+
SensorState[SensorState["UNKNOWN"] = -1] = "UNKNOWN";
|
|
29
|
+
return SensorState;
|
|
30
|
+
}({});
|
|
31
|
+
let KeyEventType = exports.KeyEventType = /*#__PURE__*/function (KeyEventType) {
|
|
32
|
+
KeyEventType[KeyEventType["KEYDOWN"] = 0] = "KEYDOWN";
|
|
33
|
+
KeyEventType[KeyEventType["KEYUP"] = 1] = "KEYUP";
|
|
34
|
+
KeyEventType[KeyEventType["KEYPRESS"] = 2] = "KEYPRESS";
|
|
35
|
+
return KeyEventType;
|
|
36
|
+
}({});
|
|
37
|
+
let KeyCodeType = exports.KeyCodeType = /*#__PURE__*/function (KeyCodeType) {
|
|
38
|
+
KeyCodeType[KeyCodeType["USB"] = 0] = "USB";
|
|
39
|
+
KeyCodeType[KeyCodeType["EVDEV"] = 1] = "EVDEV";
|
|
40
|
+
KeyCodeType[KeyCodeType["XKB"] = 2] = "XKB";
|
|
41
|
+
KeyCodeType[KeyCodeType["WIN"] = 3] = "WIN";
|
|
42
|
+
KeyCodeType[KeyCodeType["MAC"] = 4] = "MAC";
|
|
43
|
+
return KeyCodeType;
|
|
44
|
+
}({});
|
|
45
|
+
let ImageFormatType = exports.ImageFormatType = /*#__PURE__*/function (ImageFormatType) {
|
|
46
|
+
ImageFormatType[ImageFormatType["PNG"] = 0] = "PNG";
|
|
47
|
+
ImageFormatType[ImageFormatType["RGBA8888"] = 1] = "RGBA8888";
|
|
48
|
+
ImageFormatType[ImageFormatType["RGB888"] = 2] = "RGB888";
|
|
49
|
+
return ImageFormatType;
|
|
50
|
+
}({});
|
package/lib/vvd/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { IStartOptions, IStartWithSerialPort } from '../typing/Instance';
|
|
|
3
3
|
import { EmulatorConfig } from '../emulatorutil';
|
|
4
4
|
import { findInstance } from '../instance';
|
|
5
5
|
import type { DownloadFileOptions } from 'ipull';
|
|
6
|
-
import GrpcEmulator from './grpc';
|
|
6
|
+
import { GrpcEmulator } from './grpc';
|
|
7
7
|
export declare const isHeadlessEnvironment: () => boolean;
|
|
8
8
|
export declare class VvdManager {
|
|
9
9
|
private vvdHome;
|
|
10
10
|
private sdkHome;
|
|
11
11
|
binFiles: string[];
|
|
12
|
-
constructor(vvdResourcePaths
|
|
12
|
+
constructor(vvdResourcePaths?: IVvdResourcePaths);
|
|
13
13
|
static getDebuggerCfgFile(): string;
|
|
14
14
|
/**
|
|
15
15
|
* 创建Vela端的 VVD ,统一保存在 .vela/vvd 目录下
|
package/lib/vvd/index.js
CHANGED
|
@@ -62,12 +62,13 @@ exports.isHeadlessEnvironment = isHeadlessEnvironment;
|
|
|
62
62
|
class VvdManager {
|
|
63
63
|
// 需要复制的文件
|
|
64
64
|
binFiles = ['system.img', 'data.img', 'coredump.core', 'vela_data.bin', 'vela_resource.bin', 'vela_system.bin'];
|
|
65
|
-
constructor(
|
|
65
|
+
constructor() {
|
|
66
|
+
let vvdResourcePaths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
67
|
const {
|
|
67
|
-
vvdHome
|
|
68
|
+
vvdHome,
|
|
68
69
|
sdkHome
|
|
69
70
|
} = vvdResourcePaths;
|
|
70
|
-
this.vvdHome =
|
|
71
|
+
this.vvdHome = vvdHome || _constants.defaultVvdHome;
|
|
71
72
|
this.sdkHome = sdkHome || _constants.defaultSDKHome;
|
|
72
73
|
if (!_fs.default.existsSync(this.vvdHome)) {
|
|
73
74
|
_fs.default.mkdirSync(this.vvdHome, {
|
|
@@ -181,7 +182,7 @@ class VvdManager {
|
|
|
181
182
|
skin: '',
|
|
182
183
|
imageDir: '',
|
|
183
184
|
customLcdRadius: '',
|
|
184
|
-
imageType: _Vvd.VelaImageType.
|
|
185
|
+
imageType: _Vvd.VelaImageType.VELA_MIWEAR_WATCH_5
|
|
185
186
|
};
|
|
186
187
|
let currVvdDir = this.getVvdDir(vvdName);
|
|
187
188
|
const configIni = _path.default.resolve(currVvdDir, 'config.ini');
|
|
@@ -196,7 +197,7 @@ class VvdManager {
|
|
|
196
197
|
vvdInfo.imageDir = config['image.sysdir.2'];
|
|
197
198
|
vvdInfo.customImagePath = config['image.sysdir.1'];
|
|
198
199
|
vvdInfo.customLcdRadius = config['ide.lcd.radius'];
|
|
199
|
-
vvdInfo.imageType = config['ide.image.type'];
|
|
200
|
+
if (config['ide.image.type']) vvdInfo.imageType = config['ide.image.type'];
|
|
200
201
|
if (vvdInfo.skin) {
|
|
201
202
|
try {
|
|
202
203
|
vvdInfo.skinInfo = this.getSkinInfo(vvdInfo.skin, config['skin.path']);
|
|
@@ -238,7 +239,12 @@ class VvdManager {
|
|
|
238
239
|
const matcher = fileName.match(regex);
|
|
239
240
|
if (matcher) {
|
|
240
241
|
const avdName = matcher[1];
|
|
241
|
-
|
|
242
|
+
let avdInfo;
|
|
243
|
+
try {
|
|
244
|
+
avdInfo = this.getVvdInfo(avdName);
|
|
245
|
+
} catch (error) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
242
248
|
avdList.push(avdInfo);
|
|
243
249
|
}
|
|
244
250
|
}
|
|
@@ -452,7 +458,8 @@ class VvdManager {
|
|
|
452
458
|
const cmd = `${emulatorBin} -vela -avd ${options.vvdName} ${serialStr} -show-kernel ${portMappingStr} ${windowOption} ${grpcStr} ${verboseOption} -qemu ${qemuOption}`;
|
|
453
459
|
const vvdInfo = this.getVvdInfo(vvdName);
|
|
454
460
|
await this.oldEmulatorMigrate(vvdName);
|
|
455
|
-
|
|
461
|
+
const imageDir = vvdInfo.customImagePath || vvdInfo.imageDir;
|
|
462
|
+
if (!imageDir) {
|
|
456
463
|
const errMsg = `${vvdName} is not supported`;
|
|
457
464
|
_ColorConsole.default.throw(errMsg);
|
|
458
465
|
throw new Error(errMsg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiot-toolkit/emulator",
|
|
3
|
-
"version": "2.0.6-beta.
|
|
3
|
+
"version": "2.0.6-beta.3",
|
|
4
4
|
"description": "vela emulator tool.",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -23,10 +23,6 @@
|
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": ""
|
|
25
25
|
},
|
|
26
|
-
"author": {
|
|
27
|
-
"name": "juancao816",
|
|
28
|
-
"email": "caojuan2019@163.com"
|
|
29
|
-
},
|
|
30
26
|
"engines": {
|
|
31
27
|
"node": ">=12.0"
|
|
32
28
|
},
|
|
@@ -36,10 +32,10 @@
|
|
|
36
32
|
"emulator"
|
|
37
33
|
],
|
|
38
34
|
"dependencies": {
|
|
39
|
-
"@aiot-toolkit/shared-utils": "2.0.6-beta.
|
|
35
|
+
"@aiot-toolkit/shared-utils": "2.0.6-beta.3",
|
|
40
36
|
"@grpc/grpc-js": "^1.13.3",
|
|
41
37
|
"@grpc/proto-loader": "^0.7.13",
|
|
42
|
-
"@miwt/adb": "0.10.
|
|
38
|
+
"@miwt/adb": "0.10.5",
|
|
43
39
|
"adm-zip": "^0.5.16",
|
|
44
40
|
"dayjs": "^1.11.12",
|
|
45
41
|
"find-process": "^1.4.7",
|
|
@@ -53,5 +49,5 @@
|
|
|
53
49
|
"@types/adm-zip": "^0.5.5",
|
|
54
50
|
"@types/ini": "^4.1.1"
|
|
55
51
|
},
|
|
56
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "2e2ba4b1d293218736343237d963fe93c5fb27a8"
|
|
57
53
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare enum KeyEventType {
|
|
2
|
-
KEYDOWN = 0,
|
|
3
|
-
KEYUP = 1,
|
|
4
|
-
KEYPRESS = 2
|
|
5
|
-
}
|
|
6
|
-
export declare enum KeyCodeType {
|
|
7
|
-
USB = 0,
|
|
8
|
-
EVDEV = 1,
|
|
9
|
-
XKB = 2,
|
|
10
|
-
WIN = 3,
|
|
11
|
-
MAC = 4
|
|
12
|
-
}
|
|
13
|
-
export interface GrpcKeyboardEvent {
|
|
14
|
-
codeType?: KeyCodeType;
|
|
15
|
-
eventType?: KeyEventType;
|
|
16
|
-
keyCode?: number | string;
|
|
17
|
-
key?: string;
|
|
18
|
-
text?: string;
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.KeyEventType = exports.KeyCodeType = void 0;
|
|
7
|
-
let KeyEventType = exports.KeyEventType = /*#__PURE__*/function (KeyEventType) {
|
|
8
|
-
KeyEventType[KeyEventType["KEYDOWN"] = 0] = "KEYDOWN";
|
|
9
|
-
KeyEventType[KeyEventType["KEYUP"] = 1] = "KEYUP";
|
|
10
|
-
KeyEventType[KeyEventType["KEYPRESS"] = 2] = "KEYPRESS";
|
|
11
|
-
return KeyEventType;
|
|
12
|
-
}({});
|
|
13
|
-
let KeyCodeType = exports.KeyCodeType = /*#__PURE__*/function (KeyCodeType) {
|
|
14
|
-
KeyCodeType[KeyCodeType["USB"] = 0] = "USB";
|
|
15
|
-
KeyCodeType[KeyCodeType["EVDEV"] = 1] = "EVDEV";
|
|
16
|
-
KeyCodeType[KeyCodeType["XKB"] = 2] = "XKB";
|
|
17
|
-
KeyCodeType[KeyCodeType["WIN"] = 3] = "WIN";
|
|
18
|
-
KeyCodeType[KeyCodeType["MAC"] = 4] = "MAC";
|
|
19
|
-
return KeyCodeType;
|
|
20
|
-
}({});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface MouseEvent {
|
|
2
|
-
/**
|
|
3
|
-
* The horizontal coordinate. This is the physical location on the
|
|
4
|
-
* screen For example 0 indicates the leftmost coordinate.
|
|
5
|
-
*/
|
|
6
|
-
x?: number;
|
|
7
|
-
/**
|
|
8
|
-
* The vertical coordinate. This is the physical location on the screen
|
|
9
|
-
* For example 0 indicates the top left coordinate.
|
|
10
|
-
*/
|
|
11
|
-
y?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Indicates which buttons are pressed.
|
|
14
|
-
* 0: No button was pressed
|
|
15
|
-
* 1: Primary button (left)
|
|
16
|
-
* 2: Secondary button (right)
|
|
17
|
-
*/
|
|
18
|
-
buttons?: number;
|
|
19
|
-
/**
|
|
20
|
-
* The display device where the mouse event occurred.
|
|
21
|
-
* Omitting or using the value 0 indicates the main display.
|
|
22
|
-
*/
|
|
23
|
-
display?: number;
|
|
24
|
-
}
|
|
25
|
-
export interface MouseEventOutput {
|
|
26
|
-
x: number;
|
|
27
|
-
y: number;
|
|
28
|
-
buttons: number;
|
|
29
|
-
display: number;
|
|
30
|
-
}
|
|
File without changes
|