}
}
if (widget instanceof ListWidget) {
ListWidget lw = (ListWidget) widget;
if (lw.isEnabled() && lw.isFocus()) {
PacketControlAction action = null;
if (Keyboard.getEventKey() == Keyboard.KEY_DOWN && Keyboard.getEventKeyState()) {
handled = true;
lw.shiftSelection(1);
lw.onSelected(lw.getSelectedRow(), false);
lw.getSelectedItem().onClick(-1, -1, false);
action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow());
}
if (Keyboard.getEventKey() == Keyboard.KEY_UP && Keyboard.getEventKeyState()) {
handled = true;
lw.shiftSelection(-1);
lw.onSelected(lw.getSelectedRow(), false);
lw.getSelectedItem().onClick(-1, -1, false);
action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow());
}
if (Keyboard.getEventKey() == Keyboard.KEY_RETURN && Keyboard.getEventKeyState()) {
handled = true;
if (lw.getSelectedRow() != -1) {
lw.onSelected(lw.getSelectedRow(), true);
lw.getSelectedItem().onClick(-1, -1, true);
action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "doubleclick", lw.getSelectedRow());
}
}
if (action != null) {
SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action);
break;