public static void main(String[] args) throws UsbException
    {
        // Search for the missile launcher USB device and stop when not found
        UsbDevice device = findMissileLauncher(
            UsbHostManager.getUsbServices().getRootUsbHub());
        if (device == null)
        {
            System.err.println("Missile launcher not found.");
            System.exit(1);
            return;
        }

        // Claim the interface
        UsbConfiguration configuration = device.getUsbConfiguration((byte) 1);
        UsbInterface iface = configuration.getUsbInterface((byte) 1);
        iface.claim(new UsbInterfacePolicy()
        {            
            @Override
            public boolean forceClaim(UsbInterface usbInterface)
            {
                return true;
            }
        });

        // Read commands and execute them
        System.out.println("WADX = Move, S = Stop, F = Fire, Q = Exit");
        boolean exit = false;
        while (!exit)
        {
            System.out.print("> ");
            char key = readKey();
            switch (key)
            {
                case 'w':
                    sendCommand(device, CMD_UP);
                    break;

                case 'x':
                    sendCommand(device, CMD_DOWN);
                    break;

                case 'a':
                    sendCommand(device, CMD_LEFT);
                    break;

                case 'd':
                    sendCommand(device, CMD_RIGHT);
                    break;

                case 'f':
                    sendCommand(device, CMD_FIRE);
                    break;

                case 's':
                    sendCommand(device, 0);
                    break;

                case 'q':
                    exit = true;
                    break;

                default:
            }
        }
        System.out.println("Exiting");
    }