-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgamecontroller.js
More file actions
43 lines (36 loc) · 746 Bytes
/
gamecontroller.js
File metadata and controls
43 lines (36 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// @ts-check
import "@nativescript/macos-node-api";
objc.import("GameController");
class Observer extends NSObject {
static ObjCExposedMethods = {
didConnect: {
returns: interop.types.void,
params: [NSNotification],
},
};
static {
NativeClass(this);
}
/**
* @override
*/
init() {
super.init();
NSNotificationCenter.defaultCenter.addObserverSelectorNameObject(
this,
"didConnect",
GCControllerDidBecomeCurrentNotification,
null,
);
return this;
}
/**
* @param {NSNotification} _notification
*/
didConnect(_notification) {
// const controller = notification.object;
console.log(GCController.current);
}
}
Observer.new();
CFRunLoopRun();