use of org.terasology.engine.input.events.KeyRepeatEvent in project Terasology by MovingBlocks.
the class EventCopier method createNewKeyEvent.
private KeyEvent createNewKeyEvent(KeyEvent originalEvent) {
KeyEvent newEvent = null;
Class eventClass = originalEvent.getClass();
if (eventClass.equals(KeyDownEvent.class)) {
newEvent = KeyDownEvent.createCopy((KeyDownEvent) originalEvent);
} else if (eventClass.equals(KeyRepeatEvent.class)) {
newEvent = KeyRepeatEvent.createCopy((KeyRepeatEvent) originalEvent);
} else if (eventClass.equals(KeyUpEvent.class)) {
newEvent = KeyUpEvent.createCopy((KeyUpEvent) originalEvent);
} else {
logger.error("ERROR!!! Event not Identified");
}
return newEvent;
}
Aggregations