Sleeping Wombat GUI  0.100
swGUI
EventCapture.h
Go to the documentation of this file.
1 #pragma once
2 
11 
12 #include <vector>
13 
14 
15 namespace sw {
16 namespace input
17 {
18 
24 struct DebugEvent
25 {
30 };
31 
32 
33 
38 {
39 private:
40 
42 
45 
46 protected:
47 public:
48  explicit EventCapture ();
49  ~EventCapture () = default;
50 
53 
57  void QueueKeyEvent ( KeyState state, Keyboard::PhysicalKeys key );
58 
60  void QueueMouseUp ( Mouse::PhysicalButtons button );
62 
63  void QueueMouseMove ( int16 deltaX, int16 deltaY );
65 
66 public:
67 
70  void GoToNextFrame ();
71 
72  const DebugEvent& QueryEvent ( Size frameNum );
73  bool IsNext ( Size frameNum );
74 
75  void QueueEvent ( const DeviceEvent& event, Size frameNum, DeviceType deviceType, uint8 deviceIdx = 0 );
76  void QueueEvent ( const DebugEvent& event );
78 
79 };
80 
81 
82 } // input
83 } // sw
84 
85 
PhysicalButtons
Physical buttons.
Definition: InputDeviceEvent.h:215
uint16 Timestamp
Definition: InputDeviceEvent.h:19
Size FrameNumber
Definition: EventCapture.h:27
void QueueMouseUp(Mouse::PhysicalButtons button)
Definition: EventCapture.cpp:73
Definition: DirectInputModule.cpp:11
void QueueUpKeyEvent(Keyboard::PhysicalKeys key)
Adds key event to current frame and gives it next timstamp.
Definition: EventCapture.cpp:31
void QueueEvent(const DeviceEvent &event, Size frameNum, DeviceType deviceType, uint8 deviceIdx=0)
Definition: EventCapture.cpp:107
This class provides functionality of capturing events for debug and test purposes.
Definition: EventCapture.h:37
bool IsNext(Size frameNum)
Definition: EventCapture.cpp:140
KeyStates changed events.
Definition: InputDeviceEvent.h:313
DeviceEvent EventContent
Definition: EventCapture.h:26
Timestamp m_nextTimeStamp
Definition: EventCapture.h:44
void QueueMouseMove(int16 deltaX, int16 deltaY)
Definition: EventCapture.cpp:95
void QueueDownKeyEvent(Keyboard::PhysicalKeys key)
Definition: EventCapture.cpp:41
void QueueMouseEvent(KeyState state, Mouse::PhysicalButtons key)
Definition: EventCapture.cpp:83
void GoToNextFrame()
Definition: EventCapture.cpp:150
Event structure for debugging. This structure holds additionally FrameNumber. This allows user to pro...
Definition: EventCapture.h:24
Button state structure..
Definition: KeyState.h:26
size_t Size
Definition: TypesDefinitions.h:35
uint8_t uint8
Definition: TypesDefinitions.h:27
DeviceType
Input device types.
Definition: InputDeviceEvent.h:264
Size m_frameNumber
Definition: EventCapture.h:43
Abstraction of event queue.
Definition: EventQueue.h:26
DeviceType DeviceType
Definition: EventCapture.h:29
const DebugEvent & QueryEvent(Size frameNum)
Definition: EventCapture.cpp:127
void QueueMouseClick(Mouse::PhysicalButtons button)
Definition: EventCapture.cpp:63
EventCapture()
Definition: EventCapture.cpp:24
void QueueKeyEvent(KeyState state, Keyboard::PhysicalKeys key)
Definition: EventCapture.cpp:51
int16_t int16
Definition: TypesDefinitions.h:28
uint8 DeviceIdx
Definition: EventCapture.h:28
EventQueue< DebugEvent > m_events
Definition: EventCapture.h:41
PhysicalKeys
Physical keys numbers. Numbers are the same as in DirectInput.
Definition: InputDeviceEvent.h:29