}
public boolean inputEvent(final NiftyInputEvent inputEvent) {
if (inputEvent == NiftyInputEvent.NextInputElement) {
if (focusHandler != null) {
Element nextElement = focusHandler.getNext(element);
nextElement.setFocus();
return true;
}
} else if (inputEvent == NiftyInputEvent.PrevInputElement) {
if (focusHandler != null) {
Element prevElement = focusHandler.getPrev(element);
prevElement.setFocus();
return true;
}
} else if (inputEvent == NiftyInputEvent.MoveCursorDown) {
if (focusHandler != null) {
Element nextElement = focusHandler.getNext(element);
if (nextElement.getParent().equals(element.getParent())) {
nextElement.setFocus();
return true;
}
}
} else if (inputEvent == NiftyInputEvent.MoveCursorUp) {
if (focusHandler != null) {
Element prevElement = focusHandler.getPrev(element);
if (prevElement.getParent().equals(element.getParent())) {
prevElement.setFocus();
return true;
}
}
} else if (inputEvent == NiftyInputEvent.Activate) {
element.onClick();