diff --git a/gamepad.pde b/gamepad.pde index d0b129e..5ccce46 100644 --- a/gamepad.pde +++ b/gamepad.pde @@ -11,9 +11,9 @@ ControllButton buttonStart; ControllCoolieHat dpad; - -String inputDeviceName = "Controller (Xbox 360 Wireless Receiver for Windows)"; - +List devices = new ArrayList( + Arrays.asList("Controller (Xbox 360 Wireless Receiver for Windows)", + "Controller (XBOX 360 For Windows)")); String signalFromGamepad = null; @@ -29,38 +29,55 @@ void gamepad_init() try { - joypad = controllIO.getDevice(inputDeviceName); - joypad.printButtons(); - - buttonA = joypad.getButton("Button 0"); - buttonB = joypad.getButton("Button 1"); - buttonX = joypad.getButton("Button 2"); - buttonY = joypad.getButton("Button 3"); + controllIO.printDevices(); + for (int i = 0; i