protected final static Event createEvent(int type, int id){
		switch (type) {
		case TYPE_KEY_PRESS:
			return new KeyEvent(id);
		case TYPE_KEY_RELEASE:
			return new KeyEvent(id);
		case TYPE_MOTION:
			return new MotionEvent(id);
		case TYPE_ENTER:
			return new CrossingEvent(id);
		case TYPE_LEAVE:
			return new CrossingEvent(id);
		case TYPE_BUTTON_PRESS:
			return new ButtonEvent(id);
		case TYPE_BUTTON_RELEASE:
			return new ButtonEvent(id);
		case TYPE_SCROLL:
			return new ScrollEvent(id);
		case TYPE_STAGE_STATE:
			return null; // TODO
		default:
			return new Event(id);
		}
	}