@Override
    public void update() {
        if (cursorMoved) {
            int newX = location.x;
            int newY = location.y;
            int newWheel = wheelPos;

            // invert actual Y and DY for motion events
            int actualX = lastKnownLocation.x;
            int actualY = component.getHeight() - lastKnownLocation.y;
            MouseMotionEvent evt = new MouseMotionEvent(actualX, actualY,
                                                        newX - lastEventX,
                                                        lastEventY - newY,
                                                        wheelPos, lastEventWheel - wheelPos);
            listener.onMouseMotionEvent(evt);

            lastEventX = newX;
            lastEventY = newY;
            lastEventWheel = newWheel;

            cursorMoved = false;
        }

        synchronized (eventQueue) {
            eventQueueCopy.clear();
            eventQueueCopy.addAll(eventQueue);
            eventQueue.clear();
        }

        int size = eventQueueCopy.size();
        for (int i = 0; i < size; i++) {
            listener.onMouseButtonEvent(eventQueueCopy.get(i));
        }
    }
<code>AwtMouseInput</code>

@author Joshua Slack
@author MHenze (cylab)

@version $Revision$
jme3-desktop/src/main/java/com/jme3/input/awt/AwtMouseInput.java