@sensslen/node-gamepad 1.0.3-beta.4 → 1.0.3-beta.5
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/NodeGamepad.d.ts +1 -1
- package/NodeGamepad.js +2 -5
- package/package.json +1 -1
package/NodeGamepad.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class NodeGamepad extends EventEmitter {
|
|
|
22
22
|
private log;
|
|
23
23
|
private connect;
|
|
24
24
|
private stopConnectionProcess;
|
|
25
|
-
private
|
|
25
|
+
private registerProgramExitEvents;
|
|
26
26
|
private disconnect;
|
|
27
27
|
private toIDeviceSpec;
|
|
28
28
|
private onControllerFrame;
|
package/NodeGamepad.js
CHANGED
|
@@ -34,12 +34,9 @@ var NodeGamepad = /** @class */ (function (_super) {
|
|
|
34
34
|
return _this;
|
|
35
35
|
}
|
|
36
36
|
NodeGamepad.prototype.start = function () {
|
|
37
|
-
var _this = this;
|
|
38
37
|
this.log("Starting connection procedure to device:" + JSON.stringify(this.toIDeviceSpec(this.config)));
|
|
39
|
-
this.
|
|
38
|
+
this.registerProgramExitEvents();
|
|
40
39
|
this.connect();
|
|
41
|
-
// on process exit, disconnect from any devices we may be connected to. and also stop any connection procedure
|
|
42
|
-
process.on('exit', function () { return _this.stop(); });
|
|
43
40
|
};
|
|
44
41
|
NodeGamepad.prototype.stop = function () {
|
|
45
42
|
if (!this._stopped) {
|
|
@@ -111,7 +108,7 @@ var NodeGamepad = /** @class */ (function (_super) {
|
|
|
111
108
|
this._connectRetryTimeout = undefined;
|
|
112
109
|
}
|
|
113
110
|
};
|
|
114
|
-
NodeGamepad.prototype.
|
|
111
|
+
NodeGamepad.prototype.registerProgramExitEvents = function () {
|
|
115
112
|
var _this = this;
|
|
116
113
|
process.on('SIGINT', function () { return _this.stop(); });
|
|
117
114
|
process.on('exit', function () { return _this.stop(); });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensslen/node-gamepad",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.5",
|
|
4
4
|
"description": "node-gamepad is a package for node that allows you to effortlessly interface your node applications with a variety of gamepad controllers. This is a port of node-gamepad library to typescript by also removing some of the restrictions implied by this library (namely allowing gamepads to be subcleassed and also improving usb interaction)",
|
|
5
5
|
"homepage": "https://github.com/sensslen/node-gamepad",
|
|
6
6
|
"bugs": {
|