How to trigger an action?

Hey :slight_smile:
I’ve been using the latest build of JInput and everyting works fine.
However it seems that I’m unable to “make something” when I press a button.

For example if I press ‘X’ button print a message which says “You pressed ‘X’ button” or anything else.

I think your looking for this:


//Initializer start
while(!Display.isCloseRequested()){ //Or whatever loop your using, just has to loop thats all
       render();
       update();
}
//Initializer end

public void render(){
       //All your drawing code
}

public void tick(){
       if(Keyboard.isKeyDown(Keyboard.KEY_W)){
                System.out.println("W was pressed!");
        }
}


Thanks for answering :slight_smile:
However forgot to say that I’m talking about a button of a controller (I have a Acteck 3300 controller).
So If I press some button on the controller,do something.

Why not using Component.Button.X?

I’m sorry, I use JInput without the main competitor of JogAmp, I can’t be more precise.