Blender V4.3
wm_event_query.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11#include <cstdlib>
12#include <cstring>
13
14#include "DNA_listBase.h"
15#include "DNA_screen_types.h"
16#include "DNA_userdef_types.h"
18
19#include "BLI_blenlib.h"
20#include "BLI_math_rotation.h"
21#include "BLI_math_vector.h"
22#include "BLI_utildefines.h"
23
24#include "RNA_access.hh"
25
26#include "WM_api.hh"
27#include "WM_types.hh"
28
29#include "wm_event_system.hh"
30#include "wm_event_types.hh"
31
32#include "RNA_enum_types.hh"
33
34/* -------------------------------------------------------------------- */
39 const char *id;
41};
42
43static void event_ids_from_flag(char *str,
44 const int str_maxncpy,
45 const FlagIdentifierPair *flag_data,
46 const int flag_data_len,
47 const uint flag)
48{
49 int ofs = 0;
50 ofs += BLI_strncpy_rlen(str + ofs, "{", str_maxncpy - ofs);
51 for (int i = 0; i < flag_data_len; i++) {
52 if (flag & flag_data[i].flag) {
53 if (ofs != 1) {
54 ofs += BLI_strncpy_rlen(str + ofs, "|", str_maxncpy - ofs);
55 }
56 ofs += BLI_strncpy_rlen(str + ofs, flag_data[i].id, str_maxncpy - ofs);
57 }
58 }
59 ofs += BLI_strncpy_rlen(str + ofs, "}", str_maxncpy - ofs);
60 UNUSED_VARS(ofs); /* Quiet warning. */
61}
62
63static void event_ids_from_type_and_value(const short type,
64 const short val,
65 const char **r_type_id,
66 const char **r_val_id)
67{
68 /* Type. */
70
71 /* Value. */
73}
74
75void WM_event_print(const wmEvent *event)
76{
77 if (event) {
78 const char *unknown = "UNKNOWN";
79 const char *type_id = unknown;
80 const char *val_id = unknown;
81 const char *prev_type_id = unknown;
82 const char *prev_val_id = unknown;
83
84 event_ids_from_type_and_value(event->type, event->val, &type_id, &val_id);
85 event_ids_from_type_and_value(event->prev_type, event->prev_val, &prev_type_id, &prev_val_id);
86
87 char modifier_id[128];
88 {
89 FlagIdentifierPair flag_data[] = {
90 {"SHIFT", KM_SHIFT},
91 {"CTRL", KM_CTRL},
92 {"ALT", KM_ALT},
93 {"OS", KM_OSKEY},
94 };
96 modifier_id, sizeof(modifier_id), flag_data, ARRAY_SIZE(flag_data), event->modifier);
97 }
98
99 char flag_id[128];
100 {
101 FlagIdentifierPair flag_data[] = {
102 {"SCROLL_INVERT", WM_EVENT_SCROLL_INVERT},
103 {"IS_REPEAT", WM_EVENT_IS_REPEAT},
104 {"IS_CONSECUTIVE", WM_EVENT_IS_CONSECUTIVE},
105 {"FORCE_DRAG_THRESHOLD", WM_EVENT_FORCE_DRAG_THRESHOLD},
106 };
107 event_ids_from_flag(flag_id, sizeof(flag_id), flag_data, ARRAY_SIZE(flag_data), event->flag);
108 }
109
110 printf(
111 "wmEvent type:%d/%s, val:%d/%s, "
112 "prev_type:%d/%s, prev_val:%d/%s, "
113 "modifier=%s, keymodifier:%d, flag:%s, "
114 "mouse:(%d,%d), utf8:'%.*s', pointer:%p",
115 event->type,
116 type_id,
117 event->val,
118 val_id,
119 event->prev_type,
120 prev_type_id,
121 event->prev_val,
122 prev_val_id,
123 modifier_id,
124 event->keymodifier,
125 flag_id,
126 event->xy[0],
127 event->xy[1],
129 event->utf8_buf,
130 (const void *)event);
131
132#ifdef WITH_INPUT_NDOF
133 if (ISNDOF(event->type)) {
134 const wmNDOFMotionData *ndof = static_cast<const wmNDOFMotionData *>(event->customdata);
135 if (event->type == NDOF_MOTION) {
136 printf(", ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %d",
137 UNPACK3(ndof->rvec),
138 UNPACK3(ndof->tvec),
139 ndof->dt,
140 ndof->progress);
141 }
142 else {
143 /* NDOF buttons printed already. */
144 }
145 }
146#endif /* WITH_INPUT_NDOF */
147
148 if (event->tablet.active != EVT_TABLET_NONE) {
149 const wmTabletData *wmtab = &event->tablet;
150 printf(", tablet: active: %d, pressure %.4f, tilt: (%.4f %.4f)",
151 wmtab->active,
152 wmtab->pressure,
153 wmtab->x_tilt,
154 wmtab->y_tilt);
155 }
156 printf("\n");
157 }
158 else {
159 printf("wmEvent - nullptr\n");
160 }
161}
162
165/* -------------------------------------------------------------------- */
169bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
170{
171 /* Keyboard. */
172 if (mask & EVT_TYPE_MASK_KEYBOARD) {
173 if (ISKEYBOARD(event_type)) {
174 return true;
175 }
176 }
177 else if (mask & EVT_TYPE_MASK_KEYBOARD_MODIFIER) {
178 if (ISKEYMODIFIER(event_type)) {
179 return true;
180 }
181 }
182
183 /* Mouse. */
184 if (mask & EVT_TYPE_MASK_MOUSE) {
185 if (ISMOUSE(event_type)) {
186 return true;
187 }
188 }
189 else if (mask & EVT_TYPE_MASK_MOUSE_WHEEL) {
190 if (ISMOUSE_WHEEL(event_type)) {
191 return true;
192 }
193 }
194 else if (mask & EVT_TYPE_MASK_MOUSE_GESTURE) {
195 if (ISMOUSE_GESTURE(event_type)) {
196 return true;
197 }
198 }
199
200 /* NDOF. */
201 if (mask & EVT_TYPE_MASK_NDOF) {
202 if (ISNDOF(event_type)) {
203 return true;
204 }
205 }
206
207 /* Action Zone. */
208 if (mask & EVT_TYPE_MASK_ACTIONZONE) {
209 if (IS_EVENT_ACTIONZONE(event_type)) {
210 return true;
211 }
212 }
213
214 return false;
215}
216
219/* -------------------------------------------------------------------- */
224 const short init_event_type,
225 const short init_event_val)
226{
227 /* If the release-confirm preference setting is enabled,
228 * drag events can be canceled when mouse is released. */
229 if (U.flag & USER_RELEASECONFIRM) {
230 /* Option on, so can exit with km-release. */
231 if (event->val == KM_RELEASE) {
232 if ((init_event_val == KM_CLICK_DRAG) && (event->type == init_event_type)) {
233 return true;
234 }
235 }
236 else {
237 /* If the initial event wasn't a drag event then
238 * ignore #USER_RELEASECONFIRM setting: see #26756. */
239 if (init_event_val != KM_CLICK_DRAG) {
240 return true;
241 }
242 }
243 }
244 else {
245 /* This is fine as long as not doing km-release, otherwise some items (i.e. markers)
246 * being tweaked may end up getting dropped all over. */
247 if (event->val != KM_RELEASE) {
248 return true;
249 }
250 }
251
252 return false;
253}
254
256{
257 return (ISMOUSE_BUTTON(event->type) && (event->val == KM_CLICK_DRAG));
258}
259
261{
262 return WM_event_is_mouse_drag(event) ||
263 (ISMOUSE_BUTTON(event->type) && (event->val == KM_PRESS));
264}
265
267{
268 const int delta[2] = {
269 event->xy[0] - event->prev_press_xy[0],
270 event->xy[1] - event->prev_press_xy[1],
271 };
272
273 int theta = round_fl_to_int(4.0f * atan2f(float(delta[1]), float(delta[0])) / float(M_PI));
274 int val = KM_DIRECTION_W;
275
276 if (theta == 0) {
277 val = KM_DIRECTION_E;
278 }
279 else if (theta == 1) {
280 val = KM_DIRECTION_NE;
281 }
282 else if (theta == 2) {
283 val = KM_DIRECTION_N;
284 }
285 else if (theta == 3) {
286 val = KM_DIRECTION_NW;
287 }
288 else if (theta == -1) {
289 val = KM_DIRECTION_SE;
290 }
291 else if (theta == -2) {
292 val = KM_DIRECTION_S;
293 }
294 else if (theta == -3) {
295 val = KM_DIRECTION_SW;
296 }
297
298#if 0
299 /* Debug. */
300 if (val == 1) {
301 printf("tweak north\n");
302 }
303 if (val == 2) {
304 printf("tweak north-east\n");
305 }
306 if (val == 3) {
307 printf("tweak east\n");
308 }
309 if (val == 4) {
310 printf("tweak south-east\n");
311 }
312 if (val == 5) {
313 printf("tweak south\n");
314 }
315 if (val == 6) {
316 printf("tweak south-west\n");
317 }
318 if (val == 7) {
319 printf("tweak west\n");
320 }
321 if (val == 8) {
322 printf("tweak north-west\n");
323 }
324#endif
325 return val;
326}
327
328bool WM_cursor_test_motion_and_update(const int mval[2])
329{
330 static int mval_prev[2] = {-1, -1};
331 bool use_cycle = (len_manhattan_v2v2_int(mval, mval_prev) <= WM_EVENT_CURSOR_MOTION_THRESHOLD);
332 copy_v2_v2_int(mval_prev, mval);
333 return !use_cycle;
334}
335
338/* -------------------------------------------------------------------- */
343{
344 return ISMOUSE_GESTURE(event->type) || (event->type == NDOF_MOTION);
345}
346
348{
349 /* Cursor motion breaks the chain. */
350 if (ISMOUSE_MOTION(event->type)) {
351 /* Mouse motion is checked because the user may navigate to a new area
352 * and perform the same gesture - logically it's best to view this as two separate gestures. */
355 {
356 return true;
357 }
358 }
359 else if (ISKEYBOARD_OR_BUTTON(event->type)) {
360 /* Modifiers are excluded because from a user perspective,
361 * releasing a modifier (for e.g.) should not begin a new action. */
362 if (!ISKEYMODIFIER(event->type)) {
363 return true;
364 }
365 }
366 else if (event->type == WINDEACTIVATE) {
367 return true;
368 }
369
370 return false;
371}
372
375/* -------------------------------------------------------------------- */
383{
384 int drag_threshold;
386 if (ISMOUSE_BUTTON(event->prev_press_type)) {
387 /* Using the previous type is important is we want to check the last pressed/released button,
388 * The `event->type` would include #MOUSEMOVE which is always the case when dragging
389 * and does not help us know which threshold to use. */
390 if (WM_event_is_tablet(event)) {
391 drag_threshold = U.drag_threshold_tablet;
392 }
393 else {
394 drag_threshold = U.drag_threshold_mouse;
395 }
396 }
397 else {
398 /* Typically keyboard, could be NDOF button or other less common types. */
399 drag_threshold = U.drag_threshold;
400 }
401 return drag_threshold * UI_SCALE_FAC;
402}
403
404bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
405{
406 const int drag_threshold = WM_event_drag_threshold(event);
407 return abs(drag_delta[0]) > drag_threshold || abs(drag_delta[1]) > drag_threshold;
408}
409
410bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2])
411{
412 int drag_delta[2];
413 sub_v2_v2v2_int(drag_delta, prev_xy, event->xy);
414 return WM_event_drag_test_with_delta(event, drag_delta);
415}
416
417void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
418{
419 const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy;
420 r_mval[0] = xy[0] - region->winrct.xmin;
421 r_mval[1] = xy[1] - region->winrct.ymin;
422}
423
424void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
425{
426 const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy;
427 r_mval[0] = xy[0] - region->winrct.xmin;
428 r_mval[1] = xy[1] - region->winrct.ymin;
429}
430
431void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
432{
433 copy_v2_v2_int(r_xy, (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy);
434}
435
438/* -------------------------------------------------------------------- */
443{
444 if (BLI_str_utf8_size_or_error(event->utf8_buf) == 1) {
445 return event->utf8_buf[0];
446 }
447 return '\0';
448}
449
452/* -------------------------------------------------------------------- */
456int WM_userdef_event_map(int kmitype)
457{
458 switch (kmitype) {
459 case WHEELOUTMOUSE:
460 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
461 case WHEELINMOUSE:
462 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
463 }
464
465 return kmitype;
466}
467
469{
470 switch (kmitype) {
471 case WHEELOUTMOUSE:
472 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
473 case WHEELINMOUSE:
474 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
475 }
476
477 return kmitype;
478}
479
482/* -------------------------------------------------------------------- */
486#ifdef WITH_INPUT_NDOF
487
488void WM_event_ndof_pan_get(const wmNDOFMotionData *ndof, float r_pan[3], const bool use_zoom)
489{
490 int z_flag = use_zoom ? NDOF_ZOOM_INVERT : NDOF_PANZ_INVERT_AXIS;
491 r_pan[0] = ndof->tvec[0] * ((U.ndof_flag & NDOF_PANX_INVERT_AXIS) ? -1.0f : 1.0f);
492 r_pan[1] = ndof->tvec[1] * ((U.ndof_flag & NDOF_PANY_INVERT_AXIS) ? -1.0f : 1.0f);
493 r_pan[2] = ndof->tvec[2] * ((U.ndof_flag & z_flag) ? -1.0f : 1.0f);
494}
495
496void WM_event_ndof_rotate_get(const wmNDOFMotionData *ndof, float r_rot[3])
497{
498 r_rot[0] = ndof->rvec[0] * ((U.ndof_flag & NDOF_ROTX_INVERT_AXIS) ? -1.0f : 1.0f);
499 r_rot[1] = ndof->rvec[1] * ((U.ndof_flag & NDOF_ROTY_INVERT_AXIS) ? -1.0f : 1.0f);
500 r_rot[2] = ndof->rvec[2] * ((U.ndof_flag & NDOF_ROTZ_INVERT_AXIS) ? -1.0f : 1.0f);
501}
502
503float WM_event_ndof_to_axis_angle(const wmNDOFMotionData *ndof, float axis[3])
504{
505 float angle;
506 angle = normalize_v3_v3(axis, ndof->rvec);
507
508 axis[0] = axis[0] * ((U.ndof_flag & NDOF_ROTX_INVERT_AXIS) ? -1.0f : 1.0f);
509 axis[1] = axis[1] * ((U.ndof_flag & NDOF_ROTY_INVERT_AXIS) ? -1.0f : 1.0f);
510 axis[2] = axis[2] * ((U.ndof_flag & NDOF_ROTZ_INVERT_AXIS) ? -1.0f : 1.0f);
511
512 return ndof->dt * angle;
513}
514
515void WM_event_ndof_to_quat(const wmNDOFMotionData *ndof, float q[4])
516{
517 float axis[3];
518 float angle;
519
520 angle = WM_event_ndof_to_axis_angle(ndof, axis);
521 axis_angle_to_quat(q, axis, angle);
522}
523#endif /* WITH_INPUT_NDOF */
524
527/* -------------------------------------------------------------------- */
531#ifdef WITH_XR_OPENXR
532bool WM_event_is_xr(const wmEvent *event)
533{
534 return (event->type == EVT_XR_ACTION && event->custom == EVT_DATA_XR);
535}
536#endif
537
540/* -------------------------------------------------------------------- */
544float wm_pressure_curve(float raw_pressure)
545{
546 if (U.pressure_threshold_max != 0.0f) {
547 raw_pressure /= U.pressure_threshold_max;
548 }
549
550 CLAMP(raw_pressure, 0.0f, 1.0f);
551
552 if (U.pressure_softness != 0.0f) {
553 raw_pressure = powf(raw_pressure, powf(4.0f, -U.pressure_softness));
554 }
555
556 return raw_pressure;
557}
558
559float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])
560{
561 if (r_tilt) {
562 r_tilt[0] = event->tablet.x_tilt;
563 r_tilt[1] = event->tablet.y_tilt;
564 }
565
566 if (r_pen_flip) {
567 (*r_pen_flip) = (event->tablet.active == EVT_TABLET_ERASER);
568 }
569
570 return event->tablet.pressure;
571}
572
573bool WM_event_is_tablet(const wmEvent *event)
574{
575 return (event->tablet.active != EVT_TABLET_NONE);
576}
577
580/* -------------------------------------------------------------------- */
589{
590 int dx = event->xy[0] - event->prev_xy[0];
591
592 if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
593 dx = -dx;
594 }
595
596 return dx;
597}
598
600{
601 int dy = event->xy[1] - event->prev_xy[1];
602
603 if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
604 dy = -dy;
605 }
606
607 return dy;
608}
609
612/* -------------------------------------------------------------------- */
616#ifdef WITH_INPUT_IME
617bool WM_event_is_ime_switch(const wmEvent *event)
618{
619 /* Most OS's use `Ctrl+Space` / `OsKey+Space` to switch IME,
620 * so don't type in the space character.
621 *
622 * NOTE: Shift is excluded from this check since it prevented typing `Shift+Space`, see: #85517.
623 */
624 return (event->val == KM_PRESS) && (event->type == EVT_SPACEKEY) &&
625 (event->modifier & (KM_CTRL | KM_OSKEY | KM_ALT));
626}
627#endif
628
#define BLI_assert(a)
Definition BLI_assert.h:50
MINLINE int round_fl_to_int(float a)
#define M_PI
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3_v3(float r[3], const float a[3])
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
int BLI_str_utf8_size_or_error(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
unsigned int uint
#define CLAMP(a, b, c)
#define ARRAY_SIZE(arr)
#define UNUSED_VARS(...)
#define UNPACK3(a)
These structs are the foundation for all linked lists in the library system.
@ USER_WHEELZOOMDIR
@ USER_RELEASECONFIRM
@ NDOF_ROTX_INVERT_AXIS
@ NDOF_ZOOM_INVERT
@ NDOF_PANX_INVERT_AXIS
@ NDOF_PANY_INVERT_AXIS
@ NDOF_ROTY_INVERT_AXIS
@ NDOF_PANZ_INVERT_AXIS
@ NDOF_ROTZ_INVERT_AXIS
#define UI_SCALE_FAC
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Definition IK_Math.h:125
@ WM_EVENT_FORCE_DRAG_THRESHOLD
Definition WM_types.hh:663
@ WM_EVENT_SCROLL_INVERT
Definition WM_types.hh:643
@ WM_EVENT_IS_CONSECUTIVE
Definition WM_types.hh:658
@ WM_EVENT_IS_REPEAT
Definition WM_types.hh:650
@ KM_PRESS
Definition WM_types.hh:284
@ KM_CLICK_DRAG
Definition WM_types.hh:292
@ KM_RELEASE
Definition WM_types.hh:285
#define WM_EVENT_CURSOR_MOTION_THRESHOLD
Definition WM_types.hh:809
@ KM_DIRECTION_NW
Definition WM_types.hh:308
@ KM_DIRECTION_N
Definition WM_types.hh:301
@ KM_DIRECTION_SW
Definition WM_types.hh:306
@ KM_DIRECTION_NE
Definition WM_types.hh:302
@ KM_DIRECTION_E
Definition WM_types.hh:303
@ KM_DIRECTION_W
Definition WM_types.hh:307
@ KM_DIRECTION_SE
Definition WM_types.hh:304
@ KM_DIRECTION_S
Definition WM_types.hh:305
@ KM_CTRL
Definition WM_types.hh:256
@ KM_ALT
Definition WM_types.hh:257
@ KM_OSKEY
Definition WM_types.hh:259
@ KM_SHIFT
Definition WM_types.hh:255
unsigned int U
Definition btGjkEpa3.h:78
#define printf
#define powf(x, y)
#define atan2f(x, y)
#define str(s)
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
const EnumPropertyItem rna_enum_event_value_items[]
Definition rna_wm.cc:465
const EnumPropertyItem rna_enum_event_type_items[]
Definition rna_wm.cc:206
short custom
Definition WM_types.hh:758
short val
Definition WM_types.hh:724
short prev_type
Definition WM_types.hh:777
int xy[2]
Definition WM_types.hh:726
char utf8_buf[6]
Definition WM_types.hh:736
short keymodifier
Definition WM_types.hh:748
uint8_t modifier
Definition WM_types.hh:739
wmTabletData tablet
Definition WM_types.hh:751
eWM_EventFlag flag
Definition WM_types.hh:753
short prev_val
Definition WM_types.hh:779
int prev_press_xy[2]
Definition WM_types.hh:795
short type
Definition WM_types.hh:722
short prev_press_type
Definition WM_types.hh:790
float pressure
Definition WM_types.hh:671
int event_queue_consecutive_gesture_xy[2]
ccl_device_inline int abs(int x)
Definition util/math.h:120
int xy[2]
Definition wm_draw.cc:170
float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])
float wm_pressure_curve(float raw_pressure)
bool WM_event_consecutive_gesture_test_break(const wmWindow *win, const wmEvent *event)
bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
static void event_ids_from_flag(char *str, const int str_maxncpy, const FlagIdentifierPair *flag_data, const int flag_data_len, const uint flag)
int WM_event_drag_direction(const wmEvent *event)
int WM_event_absolute_delta_y(const wmEvent *event)
void WM_event_print(const wmEvent *event)
bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2])
int WM_userdef_event_map(int kmitype)
void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
bool WM_event_is_mouse_drag(const wmEvent *event)
bool WM_event_consecutive_gesture_test(const wmEvent *event)
bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
char WM_event_utf8_to_ascii(const wmEvent *event)
bool WM_event_is_mouse_drag_or_press(const wmEvent *event)
bool WM_event_is_modal_drag_exit(const wmEvent *event, const short init_event_type, const short init_event_val)
int WM_event_absolute_delta_x(const wmEvent *event)
static void event_ids_from_type_and_value(const short type, const short val, const char **r_type_id, const char **r_val_id)
int WM_userdef_event_type_from_keymap_type(int kmitype)
bool WM_event_is_tablet(const wmEvent *event)
bool WM_cursor_test_motion_and_update(const int mval[2])
int WM_event_drag_threshold(const wmEvent *event)
#define ISMOUSE_BUTTON(event_type)
#define ISKEYBOARD_OR_BUTTON(event_type)
#define ISMOUSE_MOTION(event_type)
#define ISMOUSE_WHEEL(event_type)
@ EVT_DATA_XR
eEventType_Mask
@ EVT_TYPE_MASK_ACTIONZONE
@ EVT_TYPE_MASK_KEYBOARD_MODIFIER
@ EVT_TYPE_MASK_NDOF
@ EVT_TYPE_MASK_MOUSE_WHEEL
@ EVT_TYPE_MASK_MOUSE_GESTURE
@ EVT_TYPE_MASK_MOUSE
@ EVT_TYPE_MASK_KEYBOARD
#define ISKEYMODIFIER(event_type)
#define IS_EVENT_ACTIONZONE(event_type)
#define ISMOUSE_GESTURE(event_type)
#define ISKEYBOARD(event_type)
@ WHEELUPMOUSE
@ EVT_SPACEKEY
@ WHEELDOWNMOUSE
@ MOUSEMOVE
@ NDOF_MOTION
@ WHEELOUTMOUSE
@ WHEELINMOUSE
@ WINDEACTIVATE
@ EVT_XR_ACTION
#define ISNDOF(event_type)
#define ISMOUSE(event_type)
@ EVT_TABLET_NONE
@ EVT_TABLET_ERASER
uint8_t flag
Definition wm_window.cc:138