VTK  9.3.20240329
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 
73  vtkSetMacro(KeyCode, char);
74  vtkGetMacro(KeyCode, char);
76 
78 
81  vtkSetMacro(RepeatCount, int);
82  vtkGetMacro(RepeatCount, int);
84 
86 
90  vtkSetStringMacro(KeySym);
91  vtkGetStringMacro(KeySym);
93 
98 
104  bool operator==(unsigned long VTKEvent); // event with no modifiers
105 
106 protected:
108  ~vtkEvent() override;
109 
110  unsigned long EventId;
111  int Modifier;
112  char KeyCode;
114  char* KeySym;
115 
116 private:
117  vtkEvent(const vtkEvent&) = delete;
118  void operator=(const vtkEvent&) = delete;
119 };
120 
121 VTK_ABI_NAMESPACE_END
122 #endif
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:24
char * KeySym
Definition: vtkEvent.h:114
static vtkEvent * New()
The object factory constructor.
unsigned long EventId
Definition: vtkEvent.h:110
bool operator==(vtkEvent *)
Used to compare whether two events are equal.
EventModifiers
Ways to specify modifiers to VTK events.
Definition: vtkEvent.h:44
int RepeatCount
Definition: vtkEvent.h:113
int Modifier
Definition: vtkEvent.h:111
~vtkEvent() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static int GetModifier(vtkRenderWindowInteractor *)
Convenience method computes the event modifier from an interactor.
bool operator==(unsigned long VTKEvent)
char KeyCode
Definition: vtkEvent.h:112
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
platform-independent render window interaction including picking and frame rate control.