Trouble using actionListener on mouse axies

I’m testing analogListener and actionListener on mouse axis.
Problem is :
When applied an actionListener on mouse axis, once you move the mouse you always got a TRUE for ever. any explanation?

Could you post the code and show how you’re determining it’s always true?

1 Like

Couldn’t post all, these are relative parts:

private ActionListener actionListenerc = new ActionListener() {    //ActionListener is a listener INTERFACE!
        public void onAction(String name, boolean keyPressed, float tpf) {
            keys[Integer.parseInt(name)] =keyPressed;
            if (name.equals("16") && !keyPressed )  isplaying= !isplaying;


private void initKeys(){    
// Add the names to the action listener
    inputManager.addListener(actionListenerc,new String[]{"16","37","38","39",
        "40","1","19", "4","23","17","5","18","6","26","24","41","12","201","202",


    inputManager.addMapping("204", new MouseAxisTrigger(MouseInput.AXIS_X, true));
    inputManager.addMapping("205", new MouseAxisTrigger(MouseInput.AXIS_X, false));
    inputManager.addMapping("206", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
    inputManager.addMapping("207", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
    inputManager.addMapping("208", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true));//向后滚
    inputManager.addMapping("209", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false));//向前滚


keys =new Boolean[256]; 
        for(int a = 0; a<=255;a++ ) {

Hm, can you make a small test case.
I would look into this, if you posted a with a main(String[] args).
It’s easy to copy-paste it and run it then.
It’s not easy with only the four pieces of code.