GameControl Re-Write

I've re-written much of the GameControl code and added several additional features.  I've also re-written the GameControlEditor.  If anyone is using GameControls this will most definitely break your code, but I think it's in a much better place now.

darkfrog said:

If anyone is using GameControls this will most definitely break your code, but I think it's in a much better place now.


that's our darkfrog, the way we like him  XD

We need documentation and tutorials on the Input system architecture 

The Input system architecture of the GameControl architecture?



Nearly everything you need to know is in that test class.

No, on the complete InputSystem, including the options like GameControl.

Well, I believe there is.  However, even though GameControl is written on top of the InputSystem it is meant to take the place of using the InputSystem.



To me the InputSystem is overly complicated and makes you do way too much to write a game.  However, it is very flexible, which is why I was able to write GameControl system on top of it.  You might consider just moving over to using GameControl entirely instead of the InputSystem…that's what I've done. :slight_smile:

I play around with the GameControl system. As a lazy guy I wrote the following class to write shorter code in "easy cases" (where you just have to know that a key was pressed, but don't need to know, which and when):



import com.jme.input.controls.GameControl;
import com.jme.input.controls.controller.ControlChangeListener;

public abstract class KeyChangeListener implements ControlChangeListener {
   
    public void changed(GameControl control, float oldValue, float newValue, float time) {
        if (newValue == 1.0f) {
            keyPressed();
        }
    }
   
    public abstract void keyPressed();
}



My questions:
- is there already a way to do it that easy?
- If not: Shouldn't be such a class in com.jme.input.controls.controller ?

Look at com.jme.input.controls.ActionController and com.jme.input.controls.GameControlAction.



GameControlAction has a pressed and released method.

Thanks! I was suspicious that I had overlooked something…