private void processMouse() {
        while (Mouse.next()) {
            boolean handled = false;
            for (MouseEventHandler handler: mouseEventHandlers) {
                if (Mouse.getEventButton()!=-1) {
                    if (Mouse.getEventButtonState()) {
                        handled = handler.onMouseDown(Mouse.getEventX(), Mouse.getEventY(), Mouse.getEventButton());
                    } else {
                        handled = handler.onMouseUp(Mouse.getEventX(), Mouse.getEventY(), Mouse.getEventButton());
                    }
                } else if (Mouse.getEventDWheel()!=0) {
                    handled = handler.onMouseScroll(Mouse.getEventX(), Mouse.getEventY(), Mouse.getEventDWheel());
                } else {
                    handled = handler.onMouseMove(Mouse.getEventX(), Mouse.getEventY(), Mouse.getEventDX(), Mouse.getEventDY());
                }
                if (handled) break;
            }
        }
    }