Control control = (Control) widget;
if (control.isFocus()) {
if (Keyboard.getEventKeyState()) {
handled = control.onKeyPressed(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey()));
} else {
handled = control.onKeyReleased(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey()));
}
}
if (handled) {
break;
}