801 CursorPosition += PasteBuffer.length(); |
801 CursorPosition += PasteBuffer.length(); |
802 NeedInputRender = true; |
802 NeedInputRender = true; |
803 } |
803 } |
804 break; |
804 break; |
805 |
805 |
|
806 case '\t': |
|
807 { |
|
808 int space = current_input().find (" "); |
|
809 |
|
810 if (CurrentInputState == INPUTSTATE_NORMAL |
|
811 and InputCursor > 0 |
|
812 and (space == -1 or space >= InputCursor)) |
|
813 { |
|
814 String start = current_input().mid (0, InputCursor); |
|
815 RCONSession::get_session()->request_tab_complete (start); |
|
816 } |
|
817 } |
|
818 break; |
|
819 |
806 case '\n': |
820 case '\n': |
807 case KEY_ENTER: |
821 case KEY_ENTER: |
808 switch (CurrentInputState) |
822 switch (CurrentInputState) |
809 { |
823 { |
810 case INPUTSTATE_CONFIRM_DISCONNECTION: |
824 case INPUTSTATE_CONFIRM_DISCONNECTION: |
976 Interface::set_player_names (const StringList& names) -> void |
992 Interface::set_player_names (const StringList& names) -> void |
977 { |
993 { |
978 PlayerNames = names; |
994 PlayerNames = names; |
979 NeedNicklistRender = true; |
995 NeedNicklistRender = true; |
980 } |
996 } |
|
997 |
|
998 // ------------------------------------------------------------------------------------------------- |
|
999 // |
|
1000 FUNCTION |
|
1001 Interface::tab_complete (const String& part, String complete) -> void |
|
1002 { |
|
1003 String& input = mutable_current_input(); |
|
1004 |
|
1005 if (input.starts_with (part)) |
|
1006 { |
|
1007 if (input[part.length()] != ' ') |
|
1008 complete += ' '; |
|
1009 |
|
1010 input.replace (0, part.length(), complete); |
|
1011 InputCursor = complete.length(); |
|
1012 NeedInputRender = true; |
|
1013 } |
|
1014 } |