Lemur tweak navigation

I’m using BigBanana to provide 4-way navigation.

It works fine, but when the component are layed out inside a Container then the events aren’t managed the way I want GitHub - Pesegato/BigBanana: Mouseless (bananaful?) navigation for jme3 applications

Is it possible to disable this behavior, so only BigBanana manages the focus?

Disable the navigation app state?

Edit: also note that if it’s just focus order that is a problem then that is also able to be customized.

If I disable the FocusNavigationState then my code doesn’t work as well.

I have a Control that implements FocusTraversal, which needs to be triggered by the FocusNavigationState. So I guess I have to tinker with it, or provide my own?

EDIT: Or maybe replace the Container’s FocusTraversal with one that does nothing?

I don’t know what the problem is so it’s tough to say… but that would disable the default behavior, yes.

Edit: your link says “Lemur provides two-way navigation” but that’s not the whole story, by the way. You can control the navigation and will get left/right/up/down, etc… it just (by default) treats left/up and down/right the same. See DefaultFocusTraversalControl.

…if you provide your own then you can do whatever you want for up/down/left/right/whatever.

This is exactly what I’m doing, but Lemur still try to also do its stuff. Hopefully, this time I won’t need to modify Lemur:

    getStateManager().detach(getState(FocusNavigationState.class));
    getStateManager().attach(new BananaNavigationState(inputMapper, GuiGlobals.getInstance().getFocusManagerState()));

:slight_smile:

I don’t understand why you need a special app state.

Is it because you’ve hacked around input mapper instead of putting the joystick support right into JME?

I’ve added these lines to FocusNavigationState

    /**
     * START OF DIFF FROM FocusNavigationState
     *
     * If we are inside a Container, ignore the focus change
     *
     */
    if (container instanceof Container)
        next = null;
    //END OF DIFF

Maybe not the best approach, but it works.

That was the reason for which I have a forked version of Lemur: it’s not possible to plug in an alternate version InputManager (under your suggestion btw). But that’s just half of the problem.
After a quick inspection InputManager looks like it’s built around LWJGL2 and then shoehorned into LWJGL3. If I want to add a GLFW version of it then I need to change JME interfaces and therefore a lot of stuff which is unlikely to be PR back into JME master.
Hence my suggestion to remove/deprecate LWJGL2.