API Documentation
Loading...
Searching...
No Matches
Event.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: Event
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Vector.h>
34#include <NDEVR/StringStream.h>
35namespace NDEVR
36{
37 struct Event
38 {
39
40 };
41 class KeyEvent : public Event
42 {
43 public:
44 enum KEY
45 {
46 VK_UNSPECIFIED = 0x00
47 , VK_ABNT_C1 = 0xC1
48 , VK_ABNT_C2 = 0xC2
49 , LIB_VK_ADD = 0x6B
50 , LIB_VK_ATTN = 0xF6
51 , LIB_VK_BACK = 0x08
53 , LIB_VK_CLEAR = 0x0C
54 , LIB_VK_CRSEL = 0xF7
57 , LIB_VK_EREOF = 0xF9
59 , LIB_VK_SHIFT = 0x10
60
61 , LIB_VK_LEFT = 0x25
62 , LIB_VK_UP = 0x26
63 , LIB_VK_RIGHT = 0x27
64 , LIB_VK_DOWN = 0x28
66
69 , LIB_VK_META = 0xA4
70 , LIB_VK_MENU = 0x12
71 //, LIB_VK_ESCAPE = 0x1B
74 , LIB_VK_EXSEL = 0xF8
77
78 //Number keys
79 , VK_KEY_0 = 0x30
80 , VK_KEY_1 = 0x31
81 , VK_KEY_2 = 0x32
82 , VK_KEY_3 = 0x33
83 , VK_KEY_4 = 0x34
84 , VK_KEY_5 = 0x35
85 , VK_KEY_6 = 0x36
86 , VK_KEY_7 = 0x37
87 , VK_KEY_8 = 0x38
88 , VK_KEY_9 = 0x39
89 //Letter Keys
90 , VK_KEY_A = 0x41
91 , VK_KEY_B = 0x42
92 , VK_KEY_C = 0x43
93 , VK_KEY_D = 0x44
94 , VK_KEY_E = 0x45
95 , VK_KEY_F = 0x46
96 , VK_KEY_G = 0x47
97 , VK_KEY_H = 0x48
98 , VK_KEY_I = 0x49
99 , VK_KEY_J = 0x4A
100 , VK_KEY_K = 0x4B
101 , VK_KEY_L = 0x4C
102 , VK_KEY_M = 0x4D
103 , VK_KEY_N = 0x4E
104 , VK_KEY_O = 0x4F
105 , VK_KEY_P = 0x50
106 , VK_KEY_Q = 0x51
107 , VK_KEY_R = 0x52
108 , VK_KEY_S = 0x53
109 , VK_KEY_T = 0x54
110 , VK_KEY_U = 0x55
111 , VK_KEY_V = 0x56
112 , VK_KEY_W = 0x57
113 , VK_KEY_X = 0x58
114 , VK_KEY_Y = 0x59
115 , VK_KEY_Z = 0x5A
116 //
119 //NumPad
130 //Function keys
131 , VK_KEY_F1 = 0x70
132 , VK_KEY_F2 = 0x71
133 , VK_KEY_F3 = 0x72
134 , VK_KEY_F4 = 0x73
135 , VK_KEY_F5 = 0x74
136 , VK_KEY_F6 = 0x75
137 , VK_KEY_F7 = 0x76
138 , VK_KEY_F8 = 0x77
139 , VK_KEY_F9 = 0x78
140 , VK_KEY_F10 = 0x79
141 , VK_KEY_F11 = 0x7A
142 , VK_KEY_F12 = 0x7B
143 , VK_KEY_F13 = 0x7C
144 , VK_KEY_F14 = 0x7D
145 , VK_KEY_F15 = 0x7E
146 , VK_KEY_F16 = 0x7F
147 , VK_KEY_F17 = 0x80
148 , VK_KEY_F18 = 0x81
149 , VK_KEY_F19 = 0x82
150 , VK_KEY_F20 = 0x83
151 , VK_KEY_F21 = 0x84
152 , VK_KEY_F22 = 0x85
153 , VK_KEY_F23 = 0x86
154 , VK_KEY_F24 = 0x87
155 //OEM
188 //
189 , LIB_VK_PA1 = 0xFD
191 , LIB_VK_PLAY = 0xFA
199 , LIB_VK_ZOOM = 0xFB
200 , LIB_VK_NONE = 0xFF
202
214
219 , LIB_VK_BASS_UP = 0x0204
223
224 , LIB_VK_FORWARD = 0x0301
225 , LIB_VK_STOP = 0x0302
226 , LIB_VK_REFRESH = 0x0303
227
234
235
236 };
245 {
246 SHIFT = 0x01
247 , CTRL = 0x02
248 , FUNCTION = 0x04
249 , ALT = 0x08
250 , META = 0x10
251 };
252 public:
266 bool operator==(const KeyEvent& other) const
267 {
268 return other.key_type == key_type &&
269 other.event_type == event_type &&
270 other.key_modifier == key_modifier;
271 }
272 NDEVR_BASE_API char toChar() const;
273 };
274 class WindowInstance;
327}
328
#define NDEVR_BASE_API
Definition DLLInfo.h:78
Definition Event.h:42
KeyEentType event_type
Definition Event.h:265
KEY
Definition Event.h:45
@ LIB_VK_BUTTON_R1
Definition Event.h:208
@ LIB_VK_OEM_PA1
Definition Event.h:181
@ LIB_VK_BACKSLASH
Definition Event.h:201
@ LIB_VK_OEM_ENLW
Definition Event.h:173
@ LIB_VK_MEDIA_PAUSE
Definition Event.h:233
@ VK_KEY_2
Definition Event.h:81
@ LIB_VK_OEM_5
Definition Event.h:161
@ LIB_VK_OEM_102
Definition Event.h:157
@ LIB_VK_BACK
Definition Event.h:51
@ VK_KEY_U
Definition Event.h:110
@ VK_KEY_F14
Definition Event.h:144
@ LIB_VK_ADD
Definition Event.h:49
@ VK_KEY_W
Definition Event.h:112
@ LIB_VK_LEFT
Definition Event.h:61
@ VK_KEY_Z
Definition Event.h:115
@ LIB_VK_DECIMAL
Definition Event.h:55
@ VK_KEY_T
Definition Event.h:109
@ LIB_VK_OEM_PLUS
Definition Event.h:185
@ VK_KEY_M
Definition Event.h:102
@ LIB_VK_PLAY
Definition Event.h:191
@ VK_KEY_I
Definition Event.h:98
@ LIB_VK_VOLUME_MUTE
Definition Event.h:217
@ LIB_VK_DELETE
Definition Event.h:65
@ LIB_VK_NONAME
Definition Event.h:118
@ LIB_VK_ICO_HELP
Definition Event.h:76
@ LIB_VK_OEM_PA3
Definition Event.h:183
@ LIB_VK_OEM_COMMA
Definition Event.h:170
@ VK_KEY_J
Definition Event.h:99
@ LIB_VK_BUTTON_A
Definition Event.h:203
@ LIB_VK_SUBTRACT
Definition Event.h:197
@ VK_KEY_N
Definition Event.h:103
@ VK_KEY_F15
Definition Event.h:145
@ VK_KEY_9
Definition Event.h:88
@ VK_KEY_E
Definition Event.h:94
@ LIB_VK_REFRESH
Definition Event.h:226
@ LIB_VK_OEM_FJ_TOUROKU
Definition Event.h:178
@ LIB_VK_PACKET
Definition Event.h:190
@ LIB_VK_OEM_6
Definition Event.h:162
@ LIB_VK_OEM_4
Definition Event.h:160
@ VK_KEY_0
Definition Event.h:79
@ LIB_VK_MULTIPLY
Definition Event.h:117
@ LIB_VK_META
Definition Event.h:69
@ VK_KEY_F1
Definition Event.h:131
@ LIB_VK_ZOOM
Definition Event.h:199
@ LIB_VK_CRSEL
Definition Event.h:54
@ LIB_LIB_VK_OEM_CLEAR
Definition Event.h:169
@ VK_KEY_F5
Definition Event.h:135
@ VK_KEY_5
Definition Event.h:84
@ VK_KEY_C
Definition Event.h:92
@ VK_KEY_F24
Definition Event.h:154
@ LIB_VK_OEM_PA2
Definition Event.h:182
@ VK_KEY_Q
Definition Event.h:106
@ VK_KEY_D
Definition Event.h:93
@ VK_ABNT_C2
Definition Event.h:48
@ LIB_VK_NUMPAD2
Definition Event.h:122
@ VK_KEY_P
Definition Event.h:105
@ LIB_VK_OEM_FJ_MASSHOU
Definition Event.h:176
@ LIB_VK_VOLUME_DOWN
Definition Event.h:216
@ LIB_VK_BUTTON_L1
Definition Event.h:207
@ VK_KEY_X
Definition Event.h:113
@ VK_KEY_7
Definition Event.h:86
@ LIB_VK_TREBLE_DOWN
Definition Event.h:222
@ LIB_VK_OEM_2
Definition Event.h:158
@ LIB_VK_TAB
Definition Event.h:198
@ LIB_VK_NUMPAD4
Definition Event.h:124
@ LIB_VK_OEM_BACKTAB
Definition Event.h:168
@ LIB_VK_OEM_AX
Definition Event.h:167
@ VK_KEY_B
Definition Event.h:91
@ LIB_VK_SEPARATOR
Definition Event.h:195
@ VK_KEY_F13
Definition Event.h:143
@ LIB_VK_BASS_BOOST
Definition Event.h:218
@ LIB_VK_BASS_DOWN
Definition Event.h:220
@ LIB_VK_BUTTON_MODE
Definition Event.h:211
@ LIB_VK_EQUAL
Definition Event.h:58
@ LIB_VK_ESCAPE
Definition Event.h:72
@ LIB_VK_OEM_3
Definition Event.h:159
@ LIB_VK_MENU
Definition Event.h:70
@ LIB_VK_OEM_FJ_LOYA
Definition Event.h:175
@ VK_KEY_6
Definition Event.h:85
@ LIB_VK_LCONTROL
Definition Event.h:67
@ VK_KEY_F21
Definition Event.h:151
@ LIB_VK_NUMPAD0
Definition Event.h:120
@ VK_KEY_F10
Definition Event.h:140
@ VK_KEY_F12
Definition Event.h:142
@ LIB_VK_OEM_PERIOD
Definition Event.h:184
@ LIB_VK_UP
Definition Event.h:62
@ VK_KEY_L
Definition Event.h:101
@ LIB_VK_OEM_JUMP
Definition Event.h:179
@ LIB_VK_OEM_1
Definition Event.h:156
@ VK_KEY_V
Definition Event.h:111
@ VK_KEY_G
Definition Event.h:96
@ LIB_VK_BUTTON_THUMBR
Definition Event.h:213
@ LIB_VK_OEM_FINISH
Definition Event.h:174
@ VK_KEY_F18
Definition Event.h:148
@ LIB_VK_OEM_ATTN
Definition Event.h:165
@ LIB_VK_DIVIDE
Definition Event.h:56
@ LIB_VK_RCONTROL
Definition Event.h:68
@ VK_KEY_F4
Definition Event.h:134
@ VK_KEY_F6
Definition Event.h:136
@ VK_KEY_3
Definition Event.h:82
@ LIB_VK_MEDIA_PREVIOUS
Definition Event.h:230
@ LIB_VK_SPACE
Definition Event.h:196
@ VK_KEY_K
Definition Event.h:100
@ LIB_VK_NUMPAD9
Definition Event.h:129
@ LIB_VK_TREBLE_UP
Definition Event.h:221
@ VK_KEY_F23
Definition Event.h:153
@ LIB_VK_OEM_8
Definition Event.h:164
@ VK_KEY_F16
Definition Event.h:146
@ LIB_VK_OEM_RESET
Definition Event.h:186
@ VK_KEY_A
Definition Event.h:90
@ LIB_VK_OEM_COPY
Definition Event.h:171
@ LIB_VK_BUTTON_SELECT
Definition Event.h:209
@ VK_KEY_1
Definition Event.h:80
@ VK_KEY_S
Definition Event.h:108
@ LIB_VK_VOLUME_UP
Definition Event.h:215
@ LIB_VK_NUMPAD3
Definition Event.h:123
@ LIB_VK_PA1
Definition Event.h:189
@ LIB_VK_PROCESSKEY
Definition Event.h:192
@ VK_KEY_F
Definition Event.h:95
@ LIB_VK_OEM_MINUS
Definition Event.h:180
@ LIB_VK_SELECT
Definition Event.h:194
@ VK_KEY_F20
Definition Event.h:150
@ LIB_VK_NUMPAD7
Definition Event.h:127
@ LIB_VK_RETURN
Definition Event.h:193
@ VK_KEY_F2
Definition Event.h:132
@ LIB_VK_BASS_UP
Definition Event.h:219
@ LIB_VK_DOWN
Definition Event.h:64
@ LIB_VK_OEM_FJ_ROYA
Definition Event.h:177
@ VK_KEY_F17
Definition Event.h:147
@ VK_KEY_F22
Definition Event.h:152
@ LIB_VK_BUTTON_Y
Definition Event.h:206
@ LIB_VK_BUTTON_X
Definition Event.h:205
@ LIB_VK_BUTTON_B
Definition Event.h:204
@ LIB_VK_SHIFT
Definition Event.h:59
@ VK_ABNT_C1
Definition Event.h:47
@ VK_KEY_O
Definition Event.h:104
@ VK_KEY_F8
Definition Event.h:138
@ LIB_VK_MEDIA_RECORD
Definition Event.h:232
@ LIB_VK_BUTTON_THUMBL
Definition Event.h:212
@ LIB_VK_OEM_7
Definition Event.h:163
@ LIB_VK_MEDIA_PLAY
Definition Event.h:228
@ VK_KEY_F7
Definition Event.h:137
@ VK_KEY_F9
Definition Event.h:139
@ VK_KEY_R
Definition Event.h:107
@ LIB_VK_BUTTON_START
Definition Event.h:210
@ LIB_VK_EXECUTE
Definition Event.h:73
@ VK_KEY_F11
Definition Event.h:141
@ VK_KEY_Y
Definition Event.h:114
@ VK_KEY_8
Definition Event.h:87
@ VK_KEY_H
Definition Event.h:97
@ LIB_VK_MEDIA_NEXT
Definition Event.h:231
@ LIB_VK_STOP
Definition Event.h:225
@ LIB_VK_OEM_WSCTRL
Definition Event.h:187
@ LIB_VK_NUMPAD8
Definition Event.h:128
@ LIB_VK_FORWARD
Definition Event.h:224
@ LIB_VK_RIGHT
Definition Event.h:63
@ LIB_VK_OEM_CUSEL
Definition Event.h:172
@ LIB_VK_CLEAR
Definition Event.h:53
@ LIB_VK_NUMPAD1
Definition Event.h:121
@ LIB_VK_ICO_CLEAR
Definition Event.h:75
@ LIB_VK_NUMPAD6
Definition Event.h:126
@ LIB_VK_EREOF
Definition Event.h:57
@ VK_KEY_F3
Definition Event.h:133
@ LIB_VK_NUMPAD5
Definition Event.h:125
@ LIB_VK_OEM_AUTO
Definition Event.h:166
@ VK_KEY_4
Definition Event.h:83
@ LIB_VK_MEDIA_STOP
Definition Event.h:229
@ LIB_VK_CANCEL
Definition Event.h:52
@ LIB_VK_NONE
Definition Event.h:200
@ LIB_VK_ATTN
Definition Event.h:50
@ VK_KEY_F19
Definition Event.h:149
@ VK_UNSPECIFIED
Definition Event.h:46
@ LIB_VK_EXSEL
Definition Event.h:74
KeyModifier
Definition Event.h:245
@ SHIFT
Definition Event.h:246
@ CTRL
Definition Event.h:247
@ META
Definition Event.h:250
@ FUNCTION
Definition Event.h:248
@ ALT
Definition Event.h:249
uint01 key_modifier
Definition Event.h:264
NDEVR_BASE_API char toChar() const
Definition Event.cpp:107
KEY key_type
Definition Event.h:263
bool operator==(const KeyEvent &other) const
Definition Event.h:266
KeyEvent()
Definition Event.h:253
KeyEvent(KEY key_type, uint01 key_modifier=0, KeyEentType event_type=KeyEentType::KEY_UNSPECIFIED)
Definition Event.h:258
KeyEentType
Definition Event.h:238
@ KEY_RELEASED
Definition Event.h:242
@ KEY_UNSPECIFIED
Definition Event.h:239
@ KEY_PRESSED
Definition Event.h:241
@ KEY_CLICKED
Definition Event.h:240
Definition Event.h:276
WindowInstance * window_instance
Definition Event.h:312
MouseEventType
Definition Event.h:279
@ e_mouse_dragged
Definition Event.h:281
@ e_mouse_clicked
Definition Event.h:280
@ e_mouse_released
Definition Event.h:286
@ e_mouse_pressed
Definition Event.h:285
@ e_touch_zoomed
Definition Event.h:288
@ e_mouse_moved
Definition Event.h:284
@ e_mouse_scrolled
Definition Event.h:287
@ e_mouse_entered
Definition Event.h:282
@ e_mouse_exited
Definition Event.h:283
MouseClickType
Definition Event.h:292
@ e_right_button
Definition Event.h:293
@ none
Definition Event.h:296
@ e_left_button
Definition Event.h:295
@ e_center_button
Definition Event.h:294
uint01 number_of_clicks
Definition Event.h:311
Vector< 2, fltp04 > prev_location
Definition Event.h:306
MouseEvent(WindowInstance *instance)
Definition Event.h:302
Vector< 2, fltp04 > distance_scrolled
Definition Event.h:307
uint01 key_modifier
Definition Event.h:308
Vector< 2, fltp04 > event_location
Definition Event.h:305
MouseEventType event_type
Definition Event.h:309
MouseClickType click_type
Definition Event.h:310
MouseEvent()
Definition Event.h:299
bool operator==(const MouseEvent &other) const
Definition Event.h:314
Definition StringStream.h:62
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
Definition BaseValues.hpp:272
Definition Event.h:38