asafbibas / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

hidding and showing the mouse cursor with inputManager.setCursorVisible() eventually generate wrong mouse events for Nifty #520

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call inputManager.setCursorVisible(false);
2. Do something without Nifty
3. Call inputManager.setCursorVisible(true) again

What is the expected output? What do you see instead?

InputSystemJme currently ignores all input events when the mouse cursor is 
hidden and will not forward those events to Nifty. This is the correct and 
expected behaviour.

However, when inputManager.setCursorVisible(false) is called with the mouse 
button still pressed the InputSystemJme remembers internally that the mouse 
button is pressed. When the mouse button is released while the mouse cursor is 
hidden the InputSystemJme will not be notified (since it is ignoring events).

Enabling the mouse cursor and simply moving the mouse will then send mouse down 
events to Nifty which eventually is going to trigger actions in Nifty which is 
not correct (since the mouse button has been released in the meantime).

I think it would be best to reset the internal state of the InputSystemJme when 
the mouse cursor is hidden to prevent this issue (or maybe when the mouse 
cursor is enabled).

Original issue reported on code.google.com by void65...@googlemail.com on 15 Jul 2012 at 7:01

GoogleCodeExporter commented 8 years ago
A testcase to reproduce is available on the jme forum:

http://jmonkeyengine.org/groups/gui/forum/topic/buttons-behave-oddly/

Original comment by void65...@googlemail.com on 15 Jul 2012 at 7:06

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 15 Jul 2012 at 10:02

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 15 Jul 2012 at 11:41

GoogleCodeExporter commented 8 years ago

Original comment by ShadowIs...@gmail.com on 4 Aug 2012 at 8:34

GoogleCodeExporter commented 8 years ago
Issue 500 has been merged into this issue.

Original comment by ShadowIs...@gmail.com on 4 Aug 2012 at 8:39