ControllIO controllIO; ControllDevice joypad; ControllButton buttonA; ControllButton buttonB; ControllButton buttonX; ControllButton buttonY; ControllButton buttonL; ControllButton buttonR; ControllButton buttonStart; ControllCoolieHat dpad; List devices = new ArrayList( Arrays.asList("Controller (Xbox 360 Wireless Receiver for Windows)", "Controller (XBOX 360 For Windows)")); String signalFromGamepad = null; static final String BUTTON_A_RELEASED = "ButtonAReleased"; static final String BUTTON_B_RELEASED = "ButtonBReleased"; static final String BUTTON_L_RELEASED = "ButtonLReleased"; static final String BUTTON_R_RELEASED = "ButtonRReleased"; static final String BUTTON_START_RELEASED = "ButtonStartReleased"; void gamepad_init() { controllIO = ControllIO.getInstance(this); try { controllIO.printDevices(); for (int i = 0; i LIVE_SIMPLIFICATION_MAX) liveSimplification = LIVE_SIMPLIFICATION_MAX; } if (val == 8.0) // left { pathLengthHighPassCutoff--; if (pathLengthHighPassCutoff < PATH_LENGTH_HIGHPASS_CUTOFF_MIN) pathLengthHighPassCutoff = PATH_LENGTH_HIGHPASS_CUTOFF_MIN; } else if (val == 4.0) // right { pathLengthHighPassCutoff++; if (pathLengthHighPassCutoff > PATH_LENGTH_HIGHPASS_CUTOFF_MAX) pathLengthHighPassCutoff = PATH_LENGTH_HIGHPASS_CUTOFF_MAX; } Numberbox n = (Numberbox) getAllControls().get(MODE_LIVE_SIMPLIFICATION_VALUE); n.setValue(liveSimplification); n.update(); n = (Numberbox) getAllControls().get(MODE_VECTOR_PATH_LENGTH_HIGHPASS_CUTOFF); n.setValue(pathLengthHighPassCutoff); n.update(); } void processGamepadInput() { if (signalFromGamepad != null) { println("Signal from gamepad: " + signalFromGamepad); if (signalFromGamepad == BUTTON_A_RELEASED) { if (captureShape == null && !confirmedDraw) button_mode_liveCaptureFromLive(); else if (captureShape != null && !confirmedDraw) button_mode_liveClearCapture(); else if (captureShape != null && confirmedDraw) { button_mode_liveClearCapture(); button_mode_clearQueue(); confirmedDraw = false; } } else if (signalFromGamepad == BUTTON_B_RELEASED) { if (captureShape != null && !confirmedDraw) button_mode_liveConfirmDraw(); } else if (signalFromGamepad == BUTTON_L_RELEASED) { commandQueueRunning = !commandQueueRunning; } else if (signalFromGamepad == BUTTON_R_RELEASED) { } else if (signalFromGamepad == BUTTON_START_RELEASED) { preLoadCommandQueue(); button_mode_setPositionHome(); } // clear the signal signalFromGamepad = null; } }