Our scientific app is based on SceneApplication.java from the SDK using the AWTPanels (not the Canvas) method. Inside update(), we use the mouse coordinates to determine which box on a flat field the user intends to have the current focus. In this situation, inputManager.getCursorPosition() reports the Y position using a bottom-up coordinate (Y increases from the bottom to the top of the panel). The code correctly identifies and highlights the box of interest. Works as intended until any mouse button is pressed.
When a mouse button is pressed, the Y axis inverts and Y is reported by inputManager.getCursorPosition() increasing from the top to the bottom.
inputManager.getCursorPostion() will report using a top-down coordinate system until any event is detected by an AnalogListener for mouse translation. When an event is detected, inputManager.getCursorPosition() will revert to the bottom-up Y coordinate system.
- As a work-around we’ve coded these conditions to derive a stable coordinate system but some unknown events are also resetting the coordinate and wrecking our day.
- We’ve tested the parent topComponent for extra listeners and don’t find any registered.