use of net.drewke.tdme.gui.events.GUIMouseEvent in project tdme by andreasdr.
the class GUI method mousePressed.
/*
* (non-Javadoc)
* @see com.jogamp.newt.event.MouseListener#mousePressed(com.jogamp.newt.event.MouseEvent)
*/
public void mousePressed(MouseEvent event) {
lockEvents();
GUIMouseEvent guiMouseEvent = mouseEventsPool.allocate();
guiMouseEvent.setTime(System.currentTimeMillis());
guiMouseEvent.setType(Type.MOUSE_PRESSED);
guiMouseEvent.setX(event.getX());
guiMouseEvent.setY(event.getY());
guiMouseEvent.setButton(event.getButton());
guiMouseEvent.setWheelX(event.getRotation()[0] * event.getRotationScale());
guiMouseEvent.setWheelY(event.getRotation()[1] * event.getRotationScale());
guiMouseEvent.setWheelZ(event.getRotation()[2] * event.getRotationScale());
guiMouseEvent.setProcessed(false);
mouseEvents.add(guiMouseEvent);
unlockEvents();
}
use of net.drewke.tdme.gui.events.GUIMouseEvent in project tdme by andreasdr.
the class GUI method fakeMouseMovedEvent.
/**
* Fake mouse moved event
*/
private void fakeMouseMovedEvent() {
lockEvents();
GUIMouseEvent guiMouseEvent = mouseEventsPool.allocate();
guiMouseEvent.setTime(System.currentTimeMillis());
guiMouseEvent.setType(Type.MOUSE_MOVED);
guiMouseEvent.setX(-10000);
guiMouseEvent.setY(-10000);
guiMouseEvent.setButton(0);
guiMouseEvent.setWheelX(0f);
guiMouseEvent.setWheelY(0f);
guiMouseEvent.setWheelZ(0f);
guiMouseEvent.setProcessed(false);
mouseEvents.add(guiMouseEvent);
unlockEvents();
}
use of net.drewke.tdme.gui.events.GUIMouseEvent in project tdme by andreasdr.
the class GUI method mouseReleased.
/*
* (non-Javadoc)
* @see com.jogamp.newt.event.MouseListener#mouseReleased(com.jogamp.newt.event.MouseEvent)
*/
public void mouseReleased(MouseEvent event) {
lockEvents();
GUIMouseEvent guiMouseEvent = mouseEventsPool.allocate();
guiMouseEvent.setTime(System.currentTimeMillis());
guiMouseEvent.setType(Type.MOUSE_RELEASED);
guiMouseEvent.setX(event.getX());
guiMouseEvent.setY(event.getY());
guiMouseEvent.setButton(event.getButton());
guiMouseEvent.setWheelX(event.getRotation()[0] * event.getRotationScale());
guiMouseEvent.setWheelY(event.getRotation()[1] * event.getRotationScale());
guiMouseEvent.setWheelZ(event.getRotation()[2] * event.getRotationScale());
guiMouseEvent.setProcessed(false);
mouseEvents.add(guiMouseEvent);
unlockEvents();
// add additional mouse moved event
mouseMoved(event);
}
use of net.drewke.tdme.gui.events.GUIMouseEvent in project tdme by andreasdr.
the class GUI method mouseWheelMoved.
/*
* (non-Javadoc)
* @see com.jogamp.newt.event.MouseListener#mouseWheelMoved(com.jogamp.newt.event.MouseEvent)
*/
public void mouseWheelMoved(MouseEvent event) {
lockEvents();
GUIMouseEvent guiMouseEvent = mouseEventsPool.allocate();
guiMouseEvent.setTime(System.currentTimeMillis());
guiMouseEvent.setType(Type.MOUSE_WHEEL_MOVED);
guiMouseEvent.setX(event.getX());
guiMouseEvent.setY(event.getY());
guiMouseEvent.setButton(0);
guiMouseEvent.setWheelX(event.getRotation()[0] * event.getRotationScale());
guiMouseEvent.setWheelY(event.getRotation()[1] * event.getRotationScale());
guiMouseEvent.setWheelZ(event.getRotation()[2] * event.getRotationScale());
guiMouseEvent.setProcessed(false);
mouseEvents.add(guiMouseEvent);
unlockEvents();
}
Aggregations