File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ func HandleGamepad(gamepadChannel *webrtc.DataChannel) {
4242 }()
4343
4444 var lastPad GamepadAPIXState
45-
46- var actualPad GamepadAPIXState
4745
4846 // Update the virtual device
4947 gamepadChannel .OnMessage (func (msg webrtc.DataChannelMessage ) {
@@ -52,6 +50,8 @@ func HandleGamepad(gamepadChannel *webrtc.DataChannel) {
5250 return
5351 }
5452
53+ var actualPad GamepadAPIXState
54+
5555 err := jsoniter .ConfigFastest .Unmarshal (msg .Data , & actualPad )
5656
5757 if err != nil {
Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ func gamepadAPIXToXInput(gms GamepadAPIXState) XInputState {
8282
8383 return XInputState {
8484 ID : ID (gms .Index ),
85- Connected : gms .Connected ,
85+ // Connected: gms.Connected,
86+ Connected : true ,
8687 Packet : uint32 (time .Now ().Nanosecond ()), // Different values trigger update
8788 Raw : RawControls {
8889 Buttons : convertGamepadButtons (gms .Buttons ),
You can’t perform that action at this time.
0 commit comments