If I want to assign a custom FunctionID to “Space” (which already has the UINavigation:Activate FunctionID) then the latter gets processed but not the former ( i.e. valueChanged is not called). To avoid this, I need to use a key which isn’t already assigned to UINavigation:Activate.
You should be able to register multiple functions to one key as long as they are in different groups. The active group should be the one that gets the event.
…and I know this works because in my games I can use the same keys to navigate the UI that I use to turn the camera (cursor keys). With the navigation only active when the UI is and camera keys only active when its not sort of thing.
I’m almost there. To cleanly add and remove analog listener, I need to do… things:
for (InputMapper.Mapping m : GuiGlobals.getInstance().getInputMapper().getMappings(LEFT_STICK_Y)){
GuiGlobals.getInstance().getInputMapper().removeMapping(m);
}
That’s not removing an analog listener. That’s removing a mapping. To remove an analog listener then you’d call removeAnalogListener().
The fact that your function ID is called “LEFT_STICK_Y” already makes me think that you might be using function IDs incorrectly. These are supposed to be logical functions in your game. “Jump”, “WalkForward”, “WalkSideways”, “Shoot”, whatever. Not just other names for the inputs.