diff --git a/lib/src/models/rover/rover.dart b/lib/src/models/rover/rover.dart index 5815c4b28..b02f379fc 100644 --- a/lib/src/models/rover/rover.dart +++ b/lib/src/models/rover/rover.dart @@ -22,6 +22,9 @@ class Rover extends Model { /// Listens for inputs on the second connected gamepad. final controller2 = Controller(1, ArmControls()); + /// Listens for inputs on the third connected gamepad. + final controller3 = Controller(2, CameraControls()); + /// Whether the rover is connected. bool get isConnected => models.sockets.data.isConnected; @@ -33,6 +36,7 @@ class Rover extends Model { await metrics.init(); await controller1.init(); await controller2.init(); + await controller3.init(); await settings.init(); metrics.addListener(notifyListeners); @@ -47,6 +51,7 @@ class Rover extends Model { metrics.dispose(); controller1.dispose(); controller2.dispose(); + controller3.dispose(); settings.dispose(); super.dispose(); } diff --git a/lib/src/services/gamepad.dart b/lib/src/services/gamepad.dart index c5992762c..9b07264d4 100644 --- a/lib/src/services/gamepad.dart +++ b/lib/src/services/gamepad.dart @@ -140,7 +140,7 @@ const vibrateIntensity = 65000; /// [update] to read any button presses, or else [Gamepad.state] will never update. class GamepadService extends Service { /// The maximum number of gamepads we support. - static const int numGamepads = 2; + static const int numGamepads = 3; /// A list of all the [Gamepad]s the user has connected. /// diff --git a/lib/src/widgets/generic/gamepad.dart b/lib/src/widgets/generic/gamepad.dart index d77eaff6e..8a4813ab5 100644 --- a/lib/src/widgets/generic/gamepad.dart +++ b/lib/src/widgets/generic/gamepad.dart @@ -79,6 +79,8 @@ class GamepadButtons extends StatelessWidget { GamepadButton(controller: models.rover.controller1), const SizedBox(width: 8), GamepadButton(controller: models.rover.controller2), + const SizedBox(width: 8), + GamepadButton(controller: models.rover.controller3), ], ); }