MCPcopy Create free account
hub / github.com/MITK/MITK / GetMappedEvent

Method GetMappedEvent

Modules/Core/src/Interactions/mitkEventConfig.cpp:371–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371std::string mitk::EventConfig::GetMappedEvent(const EventType &interactionEvent) const
372{
373 // internal events are excluded from mapping
374 if (std::strcmp(interactionEvent->GetNameOfClass(), "InternalEvent") == 0)
375 {
376 auto *internalEvent = dynamic_cast<InternalEvent *>(interactionEvent.GetPointer());
377 return internalEvent->GetSignalName();
378 }
379
380 for (auto it = d->m_EventList.begin(); it != d->m_EventList.end(); ++it)
381 {
382 if (*(it->interactionEvent) == *interactionEvent)
383 {
384 return (*it).variantName;
385 }
386 }
387 // if this part is reached, no mapping has been found,
388 // so here we handle key events and map a key event to the string "Std" + letter/code
389 // so "A" will be returned as "StdA"
390 if (std::strcmp(interactionEvent->GetNameOfClass(), "InteractionKeyEvent") == 0)
391 {
392 auto *keyEvent = dynamic_cast<InteractionKeyEvent *>(interactionEvent.GetPointer());
393 return ("Std" + keyEvent->GetKey());
394 }
395 return "";
396}
397
398void mitk::EventConfig::ClearConfig()
399{

Callers 2

mitkEventConfigTestFunction · 0.80
MapToEventVariantMethod · 0.80

Calls 6

GetPointerMethod · 0.80
GetSignalNameMethod · 0.80
GetNameOfClassMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetKeyMethod · 0.45

Tested by 1

mitkEventConfigTestFunction · 0.64