| 168 | } |
| 169 | |
| 170 | void cmCursesLongMessageForm::HandleInput() |
| 171 | { |
| 172 | if (!this->Form) { |
| 173 | return; |
| 174 | } |
| 175 | |
| 176 | char debugMessage[128]; |
| 177 | |
| 178 | for (;;) { |
| 179 | this->PrintKeys(); |
| 180 | int key = getch(); |
| 181 | |
| 182 | #ifdef _WIN32 |
| 183 | if (key == KEY_RESIZE) { |
| 184 | HandleResize(); |
| 185 | } |
| 186 | #endif // _WIN32 |
| 187 | |
| 188 | snprintf(debugMessage, sizeof(debugMessage), |
| 189 | "Message widget handling input, key: %d", key); |
| 190 | cmCursesForm::LogMessage(debugMessage); |
| 191 | |
| 192 | // quit |
| 193 | if (key == 'o' || key == 'e') { |
| 194 | break; |
| 195 | } |
| 196 | if (key == KEY_DOWN || key == ctrl('n') || key == 'j') { |
| 197 | form_driver(this->Form, REQ_SCR_FLINE); |
| 198 | } else if (key == KEY_UP || key == ctrl('p') || key == 'k') { |
| 199 | form_driver(this->Form, REQ_SCR_BLINE); |
| 200 | } else if (key == KEY_NPAGE || key == ctrl('d')) { |
| 201 | form_driver(this->Form, REQ_SCR_FPAGE); |
| 202 | } else if (key == KEY_PPAGE || key == ctrl('u')) { |
| 203 | form_driver(this->Form, REQ_SCR_BPAGE); |
| 204 | } |
| 205 | |
| 206 | this->UpdateStatusBar(); |
| 207 | touchwin(stdscr); |
| 208 | wrefresh(stdscr); |
| 209 | } |
| 210 | } |
nothing calls this directly
no test coverage detected