use of com.jogamp.nativewindow.util.Point in project jmonkeyengine by jMonkeyEngine.
the class NewtMouseInput method setInputSource.
public void setInputSource(GLWindow comp) {
if (component != null) {
component.removeMouseListener(this);
eventQueue.clear();
wheelPos = 0;
isRecentering = false;
eventsSinceRecenter = 0;
lastEventX = 0;
lastEventY = 0;
lastEventWheel = 0;
location = new Point();
centerLocation = new Point();
lastKnownLocation = new Point();
lockPosition = new Point();
}
component = comp;
component.addMouseListener(this);
component.addWindowListener(new WindowAdapter() {
@Override
public void windowGainedFocus(WindowEvent e) {
setCursorVisible(visible);
}
@Override
public void windowLostFocus(WindowEvent e) {
//without those lines,
//on Linux (OpenBox) the mouse is not restored if invisible (eg via Alt-Tab)
component.setPointerVisible(true);
component.confinePointer(false);
}
});
}
Aggregations