| 195 | void AEquipScreen::finish() {} |
| 196 | |
| 197 | void AEquipScreen::eventOccurred(Event *e) |
| 198 | { |
| 199 | formMain->eventOccured(e); |
| 200 | |
| 201 | // Modifiers |
| 202 | if (e->type() == EVENT_KEY_DOWN) |
| 203 | { |
| 204 | if (e->keyboard().KeyCode == SDLK_RCTRL) |
| 205 | { |
| 206 | modifierRCtrl = true; |
| 207 | } |
| 208 | if (e->keyboard().KeyCode == SDLK_LCTRL) |
| 209 | { |
| 210 | modifierLCtrl = true; |
| 211 | } |
| 212 | if (e->keyboard().KeyCode == SDLK_RSHIFT) |
| 213 | { |
| 214 | modifierRShift = true; |
| 215 | } |
| 216 | if (e->keyboard().KeyCode == SDLK_LSHIFT) |
| 217 | { |
| 218 | modifierLShift = true; |
| 219 | } |
| 220 | } |
| 221 | if (e->type() == EVENT_KEY_UP) |
| 222 | { |
| 223 | if (e->keyboard().KeyCode == SDLK_RCTRL) |
| 224 | { |
| 225 | modifierRCtrl = false; |
| 226 | } |
| 227 | if (e->keyboard().KeyCode == SDLK_LCTRL) |
| 228 | { |
| 229 | modifierLCtrl = false; |
| 230 | } |
| 231 | if (e->keyboard().KeyCode == SDLK_RSHIFT) |
| 232 | { |
| 233 | modifierRShift = false; |
| 234 | } |
| 235 | if (e->keyboard().KeyCode == SDLK_LSHIFT) |
| 236 | { |
| 237 | modifierLShift = false; |
| 238 | } |
| 239 | } |
| 240 | if (e->type() == EVENT_KEY_DOWN) |
| 241 | { |
| 242 | // Templates: |
| 243 | if (config().getBool("OpenApoc.NewFeature.EnableAgentTemplates") && |
| 244 | !formAgentStats->findControlTyped<TextEdit>("AGENT_NAME")->isFocused()) |
| 245 | { |
| 246 | switch (e->keyboard().KeyCode) |
| 247 | { |
| 248 | case SDLK_1: |
| 249 | processTemplate(1, modifierRCtrl || modifierLCtrl); |
| 250 | return; |
| 251 | case SDLK_2: |
| 252 | processTemplate(2, modifierRCtrl || modifierLCtrl); |
| 253 | return; |
| 254 | case SDLK_3: |
nothing calls this directly
no test coverage detected