public static void update() {
		mouseScroll = 0;

		if(canvas != null && canvas.getMousePosition() != null)
			mousePoint = canvas.getMousePosition();
		
		
		for(int i = 0; i < 3; i++) {
			if(mouseEvents[i] == TYPE_RELEASED)
				mouseEvents[i] = TYPE_NONE;
			
			if(mouseEvents[i] == TYPE_PRESSED)
				mouseEvents[i] = TYPE_DOWN;
		}
		
		Set<Integer> keys = keyEvents.keySet();
		for(Integer key : keys) {
			
			int type = keyEvents.get(key);
			if(type == TYPE_RELEASED)
				keyEvents.put(key, TYPE_NONE);
			
			if(type == TYPE_PRESSED)
				keyEvents.put(key, TYPE_DOWN);				
		}
	}