VTK  9.3.1
vtkEvent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkEvent_h
15 #define vtkEvent_h
16 
17 #include "vtkInteractionWidgetsModule.h" // For export macro
18 #include "vtkObject.h"
19 
20 VTK_ABI_NAMESPACE_BEGIN
22 
23 class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
24 {
25 public:
29  static vtkEvent* New();
30 
32 
35  vtkTypeMacro(vtkEvent, vtkObject);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
44  {
45  AnyModifier = -1,
46  NoModifier = 0,
47  ShiftModifier = 1,
48  ControlModifier = 2,
49  AltModifier = 4
50  };
51 
53 
56  vtkSetMacro(EventId, unsigned long);
57  vtkGetMacro(EventId, unsigned long);
59 
61 
64  vtkSetMacro(Modifier, int);
65  vtkGetMacro(Modifier, int);
67 
69 
72  vtkSetMacro(KeyCode, char);
73  vtkGetMacro(KeyCode, char);
75 
77 
80  vtkSetMacro(RepeatCount, int);
81  vtkGetMacro(RepeatCount, int);
83 
85 
88  vtkSetStringMacro(KeySym);
89  vtkGetStringMacro(KeySym);
91 
95  static int GetModifier(vtkRenderWindowInteractor*);
96 
101  bool operator==(vtkEvent*);
102  bool operator==(unsigned long VTKEvent); // event with no modifiers
103 
104 protected:
105  vtkEvent();
106  ~vtkEvent() override;
107 
108  unsigned long EventId;
109  int Modifier;
110  char KeyCode;
112  char* KeySym;
113 
114 private:
115  vtkEvent(const vtkEvent&) = delete;
116  void operator=(const vtkEvent&) = delete;
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
int RepeatCount
Definition: vtkEvent.h:111
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool VTKCOMMONCORE_EXPORT operator==(const std::string &a, const vtkStringToken &b)
EventModifiers
Ways to specify modifiers to VTK events.
Definition: vtkEvent.h:43
char KeyCode
Definition: vtkEvent.h:110
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:28
char * KeySym
Definition: vtkEvent.h:112
int Modifier
Definition: vtkEvent.h:109
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:23
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
unsigned long EventId
Definition: vtkEvent.h:108