This is an issue I’ve now been wrestling with an obscene amount of time.
I have an inventory system with slots for items on a base bar. Items are draggables that are created and placed on the droppable slots. If the GUI has been clicked (say to open the inventory), any item clicked will move as expected.
However, if the main screen (a non setVisibleToMouse area) has been clicked before a draggable is clicked, the draggable will NOT move on the first click. So, you click on the main (jME) screen, go to move an item, and it will not respond. In fact, it won’t respond to any mouse event (it appears).
I have tried to: reset focus onto the draggable using hover events; reset the mouse; make focus on the draggable element exclusive (nifty.getCurrentScreen().getFocusHandler().requestExclusiveMouseFocus(d.getElement())); manipulate the MouseInputEventQueue. I’ve tried every combination of control formation I can think of. Nothing appears to work.
I’ve been in contact with @carbonnz and he provided example code to reproduce the issue. I think we’ve fixed this now. I’m about to commit the change to svn and will update this issue here with the link to the commit.
Here is the provided example code which helped me to reproduce the issue for reference:
Box b = new Box(1, 1, 1); // create cube shape
Geometry geom = new Geometry(”Box”, b); // create cube geometry from the shape
Material mat = new Material(assetManager,
”Common/MatDefs/Misc/Unshaded.j3md”); // create a simple material
mat.setColor(”Color”, ColorRGBA.Blue); // set color of material to blue
geom.setMaterial(mat); // set the cube’s material
rootNode.attachChild(geom); // make the cube appear in the scene