Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkInteractionKeyEvent.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3  The Medical Imaging Interaction Toolkit (MITK)
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
18 
20  const std::string &key,
21  ModifierKeys modifiers = ControlKey)
22  : InteractionEvent(baseRenderer), m_Key(key), m_Modifiers(modifiers)
23 {
24 }
25 
27 {
28  return m_Modifiers;
29 }
30 
32 {
33  return m_Key;
34 }
35 
37 {
38 }
39 
41 {
42  const mitk::InteractionKeyEvent &keyEvent = static_cast<const Self &>(interactionEvent);
43  return (this->GetModifiers() == keyEvent.GetModifiers() && this->GetKey() == keyEvent.GetKey() &&
44  Superclass::IsEqual(interactionEvent));
45 }
46 
48 {
49  return (dynamic_cast<InteractionKeyEvent *>(baseClass.GetPointer()) != NULL);
50 }
Organizes the rendering process.
virtual bool IsEqual(const InteractionEvent &) const override
InteractionKeyEvent(BaseRenderer *, const std::string &key, ModifierKeys modifiers)
ModifierKeys GetModifiers() const
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override
Handles key events. Takes a std::string for pressed key or special key description, mitk::ModifierKeys for modifiers