public static void performEvents(ArrayList<HasKeyEvent> objects){
		for (Integer code : keysPressed)
			for (HasKeyEvent obj : objects)
				obj.keyPressed(code);
		for (Integer code : keysDown)
			for (HasKeyEvent obj : objects)
				obj.keyDown(code);
		for (Integer code : keysReleased)
			for (HasKeyEvent obj : objects)
				obj.keyReleased(code);
		
		for (Integer code : keysPressed){//transfer keyPressed events to keyDown
			keysDown.add(code);
		}
		keysPressed.clear();
		
		keysReleased.clear();
	}