public static void main( String[] args ) throws LWJGLException
    {
        Controllers.create();
        Controllers.poll();

        for ( int i = 0; i < Controllers.getControllerCount(); i++ )
        {
            controller = Controllers.getController( i );
            System.out.println( "(" + i + ") " + controller.getName() );
        }

        System.out.println(); // blank line

        Scanner scanner = new Scanner( System.in );

        System.out.print( "Which controller index?  " );
        int answer = scanner.nextInt();

        scanner.close();
        System.out.println();

        controller = Controllers.getController( answer );

        for ( int i = 0; i < controller.getAxisCount(); i++ )
        {
            System.out.println( "Axis detected:  (" + i + ") " + controller.getAxisName( i ) );
        }

        for ( int i = 0; i < controller.getButtonCount(); i++ )
        {
            System.out.println( "Button detected:  (" + i + ") " + controller.getButtonName( i ) );
        }

        System.out.println( "Detected " + controller.getRumblerCount() + " rumbler(s)" );

        setup();

        while ( !Display.isCloseRequested() )
        {
            controller.poll();
            update();

            for ( int i = 0; i < controller.getRumblerCount(); i++ )
            {
                controller.setRumblerStrength( i, 1f );
            }

            if ( controller.getAxisValue( 4 ) != 0 )
            {
                System.out.println( controller.getAxisValue( 4 ) ); // right trigger is [-1,0), left (0,1]
            }

            Display.update();
            Display.sync( 60 );
        }

        destroy();
    }