-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
8u66
-
x86
-
other
A DESCRIPTION OF THE REQUEST :
Up to now, no public API is available to access the current mouse pointer location (when the mouse it not moved). There is a workaround using java.awt.MouseInfo.getPointerLocation(), which does not work for Mac:
PointerInfo pi = MouseInfo.getPointerInfo();
java.awt.Point mp = pi.getLocation();
On Mac there is the following workaround using com.sun.glass.ui.Robot, which is not public API:
com.sun.glass.ui.Robot robot = com.sun.glass.ui.Application
.GetApplication().createRobot();
Point mp = new Point(robot.getMouseX(), robot.getMouseY());
There is no direct means to obtain the current pointer location through JavaFX public API.
JUSTIFICATION :
There is no direct means to retrieve the current mouse pointer location via public API of JavaFX. The workaround for Mac relies on accessing JDK internal API, so that this workaround will no longer work with Jigsaw:
-> com.sun.glass.ui.Application JDK internal API (javafx.graphics)
-> com.sun.glass.ui.Robot JDK internal API (javafx.graphics)
Up to now, no public API is available to access the current mouse pointer location (when the mouse it not moved). There is a workaround using java.awt.MouseInfo.getPointerLocation(), which does not work for Mac:
PointerInfo pi = MouseInfo.getPointerInfo();
java.awt.Point mp = pi.getLocation();
On Mac there is the following workaround using com.sun.glass.ui.Robot, which is not public API:
com.sun.glass.ui.Robot robot = com.sun.glass.ui.Application
.GetApplication().createRobot();
Point mp = new Point(robot.getMouseX(), robot.getMouseY());
There is no direct means to obtain the current pointer location through JavaFX public API.
JUSTIFICATION :
There is no direct means to retrieve the current mouse pointer location via public API of JavaFX. The workaround for Mac relies on accessing JDK internal API, so that this workaround will no longer work with Jigsaw:
-> com.sun.glass.ui.Application JDK internal API (javafx.graphics)
-> com.sun.glass.ui.Robot JDK internal API (javafx.graphics)
- duplicates
-
JDK-8090763 FX Robot API
- Resolved
- relates to
-
JDK-8090763 FX Robot API
- Resolved