| 765 | } |
| 766 | |
| 767 | EventState OnKeyPress([[maybe_unused]] char32_t key, uint16_t keycode) override |
| 768 | { |
| 769 | EventState state = ES_NOT_HANDLED; |
| 770 | |
| 771 | /* handle up, down, pageup, pagedown, home and end */ |
| 772 | if (this->vscroll->UpdateListPositionOnKeyPress(this->list_pos, keycode) == ES_HANDLED) { |
| 773 | if (this->list_pos == SLP_INVALID) return ES_HANDLED; |
| 774 | |
| 775 | this->server = this->servers[this->list_pos]; |
| 776 | |
| 777 | /* Scroll to the new server if it is outside the current range. */ |
| 778 | this->ScrollToSelectedServer(); |
| 779 | |
| 780 | /* redraw window */ |
| 781 | this->SetDirty(); |
| 782 | return ES_HANDLED; |
| 783 | } |
| 784 | |
| 785 | if (this->server != nullptr) { |
| 786 | if (keycode == WKC_DELETE) { // Press 'delete' to remove servers |
| 787 | NetworkGameListRemoveItem(this->server); |
| 788 | if (this->server == this->last_joined) this->last_joined = nullptr; |
| 789 | this->server = nullptr; |
| 790 | this->list_pos = SLP_INVALID; |
| 791 | } |
| 792 | } |
| 793 | |
| 794 | return state; |
| 795 | } |
| 796 | |
| 797 | void OnEditboxChanged(WidgetID wid) override |
| 798 | { |
nothing calls this directly
no test coverage detected