The following will use this image as a reference:
http://www.danyrioux.com/files/screenie.png
In my game, when the user release a left mouse click while hovering above the screen (that isn’t a GUI element) it initiates a picking. If nothing is chosen, the selection is removed (the preview at the bottom right).
If I hold left click and drag up to a nifty button (i.e. “More Information”) then release the mouse, the GUI button never receives the click (that button uses “onRelease” to trigger its method). Effectively, the “picking” method is triggered and closes the preview window (unless the click was initiated on a star, in which case the preview would switch to that star. Still the button wouldn’t be triggered).
The reverse is also true. If I initiate a click on a button then drag elsewhere, the button’s method is triggered when the “drag” is stopped even if the mouse isn’t over the GUI element. (Nifty gets REALLY confused when I do that, but that’s beside this topic.)
EDIT: The problem here is the initial click dictates what will receive the release event, which bring me to the following change.
I would propose a change to InputSystemJme.
An event should be triggered for both the pressed and the released to the InputManager and to Nifty. Pressed at the coordinates at which it was initiated and the release where that happened. That way, it falls to the programmer to make sure his keystrokes implementation don’t interfere with each others.
Hopefully that makes sense.