Lemur Button consumed jme3 event from the input manager

I try to work with Lemur 1.15.0, but on rootNode and not on guiNode.

Now I have written camera control: If I press the right mouse button, the camera rotates, if I let go, the cursor appears back.

	final static String CAM_ROTATE = "CAM_ROTATE";
	private final ActionListener rotateListener = (name, keyPressed, tpf) -> {
		setRotateCamera(keyPressed);
	};
(..)
	protected void setRotateCamera(final boolean rotateCamera) {
		this.rotateCamera = rotateCamera;
		inputManager.setCursorVisible(!rotateCamera);
	}
(..)
inputManager.addMapping(CAM_ROTATE, new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(rotateListener, CAM_ROTATE);

The axis events are processed depending on this.rotateCamera.

image

But when I stop rotating just above the “Click me” button, Lemur eats the mouse event and my camera continues rotating happily.

How can I ask Lemur not to consume this event?
Or at least as long as I rotate lemur mute briefly?

If it didn’t get the down event then it’s not supposed to consume the up event so that may be a bug.

GuiGlobals.getInstance().setCursorEventsEnabled(false);

1 Like

Then I want to report a bug.
Edited: If I click the right mouse button on the Lemur button, then the Lemur button is pressed, the event is consumed and thus no rotate is triggered. That’s okay.

Thank you very much, that helps …

protected void setRotateCamera(final boolean rotateCamera) {
		this.rotateCamera = rotateCamera;
		inputManager.setCursorVisible(!rotateCamera);
		GuiGlobals.getInstance().setCursorEventsEnabled(!rotateCamera);
}

setCursorEventsEnabled() will already turn on/off the mouse cursor for you.

1 Like