| 369 | } |
| 370 | |
| 371 | std::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 | |
| 398 | void mitk::EventConfig::ClearConfig() |
| 399 | { |