SimpleApp Keybindings

I have assigned a new functionality(to move a object) with the key_left key, but, the pre-determined action(cam rotation) is not removed.So,both actions are taking place.



How do i detach these previous key bindings? How to overwrite them one by one and all of them at once.

[java] flyCam.setEnabled(false);

[/java]

But, what if I wanna remove just that particular key binding, keeping all others unchanged?



Because [java]flyCam.setEnabled(false);[/java] is removing the key binding of WASD too, which i dont want.

Remove the single bindings via InputManager.deleteMapping(). Look at the source of flyCam to see their names (right-click a flyCam variable and select “Navigate->Go to Source”).

  1. When I use this line

    [java]inputManager.deleteMapping(“FLYCAM_Left”);[/java]



    it also removes, the mouse movement that helps to move the camera left.

    [java] inputManager.addMapping(“FLYCAM_Left”, new MouseAxisTrigger(0, true),

    new KeyTrigger(KeyInput.KEY_LEFT));[/java]



    How do I particularly, remove Key_left, keeping everything else untouched.


  2. I am a little confused about the Vector system, when It comes to relative initial point.

    I mean, when I write a vector like Vector3f(3,5,7) it is pointing towards a point in 3d space, at +3 along x, +5 along y and +7 along z.But, every time, I am starting from (0,0,0).



    So, What to do , If i need to point to somewhere, when the vector dont start from (0,0,0), rather then it starts from a relative point.

    Say, Vector A and Vector B.I need the vector that, points to the head of B starting from the head of A.



    Is that any way, to declare it?

1)

[java]

inputManager.deleteMapping(“FLYCAM_Left”);

inputManager.addMapping(“FLYCAM_Left”, new MouseAxisTrigger(0, true));

[/java]



2)

[java]VectorB.subtract(VectorA);[/java]

[java]inputManager.deleteMapping(“FLYCAM_Left”);

inputManager.addMapping(“FLYCAM_Left”, new MouseAxisTrigger(0, true));[/java]



the problem remains.Mouse is not working.

Hm, might be you have to readd the flyCam as a listener for the mapping (again look at the source of flyCam how its done).

you mean, detaching all the controls and reimplementing as I need them to be?

No, just the one you want, same code I posted but add a line with something like inputmanager.registerListener(“FLYCAM_left”, flyCam);

I have tried some but no of them work.How do you actually implement a listener/remap a string without implementing them inside ActionListener or AnalogListener.

You can add a mapping from anywhere, to be able to listen you have to implement the listener interface.