MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / eventOccurred

Method eventOccurred

game/ui/general/aequipscreen.cpp:197–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195void AEquipScreen::finish() {}
196
197void 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:

Callers

nothing calls this directly

Calls 11

typeMethod · 0.80
getBoolMethod · 0.80
findControlMethod · 0.80
emptyMethod · 0.80
withinMethod · 0.80
eventOccuredMethod · 0.45
isFocusedMethod · 0.45
clickMethod · 0.45
getEquipmentAtMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected