| 171 | #endif |
| 172 | |
| 173 | static void DedicatedHandleKeyInput() |
| 174 | { |
| 175 | if (!InputWaiting()) return; |
| 176 | |
| 177 | if (_exit_game) return; |
| 178 | |
| 179 | std::string input_line; |
| 180 | #if defined(UNIX) |
| 181 | if (!std::getline(std::cin, input_line)) return; |
| 182 | #else |
| 183 | /* Handle console input, and signal console thread, it can accept input again */ |
| 184 | std::swap(input_line, _win_console_thread_buffer); |
| 185 | SetEvent(_hWaitForInputHandling); |
| 186 | #endif |
| 187 | |
| 188 | /* Remove any trailing \r or \n, and ensure the string is valid. */ |
| 189 | auto p = input_line.find_last_not_of("\r\n"); |
| 190 | if (p != std::string::npos) p++; |
| 191 | IConsoleCmdExec(StrMakeValid(input_line.substr(0, p))); |
| 192 | } |
| 193 | |
| 194 | void VideoDriver_Dedicated::MainLoop() |
| 195 | { |
no test coverage detected