Mercurial’s gamepads are a thin wrapper over Pasteurized
Gamepads. Go give the Pasteurized docs a look first.
The basic differences are:
Mercurial gamepads have support for command bindings.
Mercurial gamepads are obtained from Mercurial, rather than from Pasteurized.
BoundGamepad g1 =Mercurial.gamepad1();Mercurial.gamepad2();// remember, we can set the whole gamepad at onceMercurial.gamepad2(Mercurial.gamepad1());
Mercurial’s BoundBooleanSupplier and BoundDoubleSupplier can both be built
from wrapping their Enhanced equivalents, or directly, see bindings for
examples.
You can combine buttons, sticks, triggers in the same ways as you can in
Pasteurized.
Additionally, the layering systems will work as well:
BoundGamepad teleopGamepad =newBoundGamepad(newSDKGamepad(gamepad1));BoundGamepad endgameGamepad =newBoundGamepad(newSDKGamepad(gamepad1));Map<Layers,BoundGamepad> mercurialGamepadMap =newHashMap<Layers,BoundGamepad>(){{put(Layers.TELEOP, teleopGamepad);put(Layers.ENDGAME, endgameGamepad);}};MapLayeringSystem<Layers,BoundDoubleSupplier,BoundBooleanSupplier,BoundGamepad> enumLayeringSystem =newMapLayeringSystem<>(Layers.TELEOP, pasteurizedGamepadMap);// LayeredGamepad takes a LayeringSystem and makes a gamepad from itLayeredGamepad<BoundDoubleSupplier,BoundBooleanSupplier,BoundGamepad> layeredGamepad =newLayeredGamepad<>(enumLayeringSystem);// now, modify teleop and endgame gamepads,// then bind commands to them individually// don't bind commands to the layered gamepad,// as this will not do what you expect