public void poll() {
		Keyboard.enableRepeatEvents(false);
		keyEvents.clear();
		keyPressEvents.clear();
		mouseEvents.clear();
		mousePressEvents.clear();
		while (Keyboard.next()) {
			Integer k = Keyboard.getEventKey();
			boolean down = Keyboard.getEventKeyState();
			keyEvents.add(new Duple<Integer, Boolean>(k, down));
			if (down)
				keyPressEvents.add(k);
			if (down && !downKeys.contains(k))
				downKeys.add(k);
			else
				downKeys.remove(k);
			keyCharMap.put(k, Keyboard.getEventCharacter());
		}
		while (Mouse.next()) {
			Integer k = Mouse.getEventButton();
			boolean down = Mouse.getEventButtonState();
			Triple<Integer, Boolean, Duple<Integer, Integer>> t = new Triple<Integer, Boolean, Duple<Integer, Integer>>(
					k, down, new Duple<Integer, Integer>(Mouse.getEventX(),
							Mouse.getEventY()));
			mouseEvents.add(t);
			if (down)
				mousePressEvents.add(k);
			if (down && !downMouseButtons.contains(k))
				downMouseButtons.add(k);
			else
				downMouseButtons.remove(k);
		}
		mousePos = new Duple<Integer, Integer>(Mouse.getX(), Mouse.getY());
		mouseDelta = new Duple<Integer, Integer>(Mouse.getDX(), Mouse.getDY());
	}