Solved! Modify FlyByCamera without recreating it?

I would like to modfy the input keys of the FlyByCamera, without recreating it.

Since all is about mapping I tried with this code:



[java]

inputManager.deleteMapping(“FLYCAM_RotateDrag”);

inputManager.addMapping(“FLYCAM_RotateDrag”, new MouseButtonTrigger(MouseInput.BUTTON_MIDDLE));

inputManager.addListener(app.getFlyByCamera());

[/java]



All I want to do is change MousInput.BUTTON_LEFT to MouseInput.BUTTON_MIDDLE

If I only use inputManager.addMapping(“FLYCAM_RotateDrag”, new MouseButtonTrigger(MouseInput.BUTTON_MIDDLE)); I can use both buttons.

Therefore my first step is to delete the mapping FLYCAM_RotateDrag.

In my second step I want to recreate the mapping, but it doesn’t work! No reaction! What do I do wrong?



EDIT:

OK, I found my error

inputManager.addListener(app.getFlyByCamera(), “FLYCAM_RotateDrag”);

Didn’t see that! Sorry

1 Like