Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::InteractionKeyEvent Class Reference

Represents a keyboard interaction event. More...

#include <mitkInteractionKeyEvent.h>

Inheritance diagram for mitk::InteractionKeyEvent:
Collaboration diagram for mitk::InteractionKeyEvent:

Public Member Functions

 mitkClassMacro (InteractionKeyEvent, InteractionEvent) mitkNewMacro3Param(Self
 
bool IsSuperClassOf (const InteractionEvent::Pointer &baseClass) const override
 Check if the provided event is an InteractionKeyEvent or derived. More...
 
ModifierKeys GetModifiers () const
 Get the modifier keys held during this key event. More...
 
std::string GetKey () const
 Get the key that was pressed. More...
 
- Public Member Functions inherited from mitk::InteractionEvent
 mitkClassMacroItkParent (InteractionEvent, itk::LightObject)
 
 mitkNewMacro1Param (Self, BaseRenderer *)
 
void SetSender (BaseRenderer *sender)
 Set the BaseRenderer that sent this event. More...
 
BaseRenderer * GetSender () const
 Get the BaseRenderer that sent this event. More...
 

Public Attributes

BaseRenderer const std::string ModifierKeys
 

Protected Member Functions

 InteractionKeyEvent (BaseRenderer *, const std::string &key, ModifierKeys modifiers)
 
 ~InteractionKeyEvent () override
 
bool IsEqual (const InteractionEvent &) const override
 
- Protected Member Functions inherited from mitk::InteractionEvent
 InteractionEvent (BaseRenderer *)
 
 ~InteractionEvent () override
 

Additional Inherited Members

- Public Types inherited from mitk::InteractionEvent
enum  MouseButtons { NoButton , LeftMouseButton , RightMouseButton , MiddleMouseButton }
 Enumeration of mouse button states. More...
 
enum  ModifierKeys { NoKey , ShiftKey , ControlKey , AltKey }
 Enumeration of keyboard modifier keys. More...
 
- Static Public Attributes inherited from mitk::InteractionEvent
static const std::string KeyEsc
 String constants for special keys used in key events and state machine patterns. More...
 
static const std::string KeyEnter
 "Enter" key constant. More...
 
static const std::string KeyReturn
 "Return" key constant. More...
 
static const std::string KeyDelete
 "Delete" key constant. More...
 
static const std::string KeyArrowUp
 "ArrowUp" key constant. More...
 
static const std::string KeyArrowDown
 "ArrowDown" key constant. More...
 
static const std::string KeyArrowLeft
 "ArrowLeft" key constant. More...
 
static const std::string KeyArrowRight
 "ArrowRight" key constant. More...
 
static const std::string KeyF1
 "F1" key constant. More...
 
static const std::string KeyF2
 "F2" key constant. More...
 
static const std::string KeyF3
 "F3" key constant. More...
 
static const std::string KeyF4
 "F4" key constant. More...
 
static const std::string KeyF5
 "F5" key constant. More...
 
static const std::string KeyF6
 "F6" key constant. More...
 
static const std::string KeyF7
 "F7" key constant. More...
 
static const std::string KeyF8
 "F8" key constant. More...
 
static const std::string KeyF9
 "F9" key constant. More...
 
static const std::string KeyF10
 "F10" key constant. More...
 
static const std::string KeyF11
 "F11" key constant. More...
 
static const std::string KeyF12
 "F12" key constant. More...
 
static const std::string KeyPos1
 "Pos1" (Home) key constant. More...
 
static const std::string KeyEnd
 "End" key constant. More...
 
static const std::string KeyInsert
 "Insert" key constant. More...
 
static const std::string KeyPageUp
 "PageUp" key constant. More...
 
static const std::string KeyPageDown
 "PageDown" key constant. More...
 
static const std::string KeySpace
 "Space" key constant. More...
 

Detailed Description

Represents a keyboard interaction event.

Stores the pressed key (as a string, including special key constants from InteractionEvent) and the modifier keys held during the event. Two InteractionKeyEvents are considered equal if they have the same key and the same modifiers.

See also
InteractionEvent
InteractionPositionEvent

Definition at line 44 of file mitkInteractionKeyEvent.h.

Constructor & Destructor Documentation

◆ InteractionKeyEvent()

mitk::InteractionKeyEvent::InteractionKeyEvent ( BaseRenderer *  ,
const std::string &  key,
ModifierKeys  modifiers 
)
protected

◆ ~InteractionKeyEvent()

mitk::InteractionKeyEvent::~InteractionKeyEvent ( )
overrideprotected

Member Function Documentation

◆ GetKey()

std::string mitk::InteractionKeyEvent::GetKey ( ) const

Get the key that was pressed.

Returns
The key as a string. For special keys, this matches the KeyXxx constants.

◆ GetModifiers()

ModifierKeys mitk::InteractionKeyEvent::GetModifiers ( ) const

Get the modifier keys held during this key event.

Returns
The modifier keys as a ModifierKeys bitmask.

◆ IsEqual()

bool mitk::InteractionKeyEvent::IsEqual ( const InteractionEvent &  ) const
overrideprotectedvirtual

Reimplemented from mitk::InteractionEvent.

◆ IsSuperClassOf()

bool mitk::InteractionKeyEvent::IsSuperClassOf ( const InteractionEvent::Pointer &  baseClass) const
overridevirtual

Check if the provided event is an InteractionKeyEvent or derived.

Parameters
[in]baseClassThe event to check.
Returns
true if baseClass is an InteractionKeyEvent or derived from it.

Reimplemented from mitk::InteractionEvent.

◆ mitkClassMacro()

mitk::InteractionKeyEvent::mitkClassMacro ( InteractionKeyEvent  ,
InteractionEvent   
)

Member Data Documentation

◆ ModifierKeys


The documentation for this class was generated from the following file: