private static Event nextEvent() {
		
		Event e = null;
		
		if (Keyboard.next()) {
			if (Keyboard.getEventKeyState()) {
				e = new Event(EventType.KEY_PRESSED, Keyboard.getEventKey());
			} else {
				e = new Event(EventType.KEY_RELEASED, Keyboard.getEventKey());
			}			
		}
		
		if (Mouse.next()) {
			if (Mouse.getEventDX() != 0 || Mouse.getEventDY() != 0)
				e = new Event(EventType.MOUSE_MOVE, 0);
			else if (Mouse.getEventButtonState())
		    	e = new Event(EventType.MOUSE_PRESSED, Mouse.getEventButton());
			else
		    	e = new Event(EventType.MOUSE_RELEASED, Mouse.getEventButton());
		    
		}
		
		
		return e;
	}