Blender  V3.3
wm_event_query.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2007 Blender Foundation. All rights reserved. */
3 
10 #include <stdlib.h>
11 #include <string.h>
12 
13 #include "DNA_listBase.h"
14 #include "DNA_scene_types.h"
15 #include "DNA_screen_types.h"
16 #include "DNA_userdef_types.h"
18 
19 #include "BLI_blenlib.h"
20 #include "BLI_math.h"
21 #include "BLI_utildefines.h"
22 
23 #include "BKE_context.h"
24 
25 #include "RNA_access.h"
26 
27 #include "WM_api.h"
28 #include "WM_types.h"
29 
30 #include "wm_event_system.h"
31 #include "wm_event_types.h"
32 
33 #include "RNA_enum_types.h"
34 
35 #include "DEG_depsgraph.h"
36 
37 /* -------------------------------------------------------------------- */
42  const char *id;
44 };
45 
46 static void event_ids_from_flag(char *str,
47  const int str_maxlen,
48  const struct FlagIdentifierPair *flag_data,
49  const int flag_data_len,
50  const uint flag)
51 {
52  int ofs = 0;
53  ofs += BLI_strncpy_rlen(str + ofs, "{", str_maxlen - ofs);
54  for (int i = 0; i < flag_data_len; i++) {
55  if (flag & flag_data[i].flag) {
56  if (ofs != 1) {
57  ofs += BLI_strncpy_rlen(str + ofs, "|", str_maxlen - ofs);
58  }
59  ofs += BLI_strncpy_rlen(str + ofs, flag_data[i].id, str_maxlen - ofs);
60  }
61  }
62  ofs += BLI_strncpy_rlen(str + ofs, "}", str_maxlen - ofs);
63 }
64 
65 static void event_ids_from_type_and_value(const short type,
66  const short val,
67  const char **r_type_id,
68  const char **r_val_id)
69 {
70  /* Type. */
72 
73  /* Value. */
75 }
76 
77 void WM_event_print(const wmEvent *event)
78 {
79  if (event) {
80  const char *unknown = "UNKNOWN";
81  const char *type_id = unknown;
82  const char *val_id = unknown;
83  const char *prev_type_id = unknown;
84  const char *prev_val_id = unknown;
85 
86  event_ids_from_type_and_value(event->type, event->val, &type_id, &val_id);
87  event_ids_from_type_and_value(event->prev_type, event->prev_val, &prev_type_id, &prev_val_id);
88 
89  char modifier_id[128];
90  {
91  struct FlagIdentifierPair flag_data[] = {
92  {"SHIFT", KM_SHIFT},
93  {"CTRL", KM_CTRL},
94  {"ALT", KM_ALT},
95  {"OS", KM_OSKEY},
96  };
98  modifier_id, sizeof(modifier_id), flag_data, ARRAY_SIZE(flag_data), event->modifier);
99  }
100 
101  char flag_id[128];
102  {
103  struct FlagIdentifierPair flag_data[] = {
104  {"SCROLL_INVERT", WM_EVENT_SCROLL_INVERT},
105  {"IS_REPEAT", WM_EVENT_IS_REPEAT},
106  {"FORCE_DRAG_THRESHOLD", WM_EVENT_FORCE_DRAG_THRESHOLD},
107  };
108  event_ids_from_flag(flag_id, sizeof(flag_id), flag_data, ARRAY_SIZE(flag_data), event->flag);
109  }
110 
111  printf(
112  "wmEvent type:%d/%s, val:%d/%s, "
113  "prev_type:%d/%s, prev_val:%d/%s, "
114  "modifier=%s, keymodifier:%d, flag:%s, "
115  "mouse:(%d,%d), utf8:'%.*s', pointer:%p",
116  event->type,
117  type_id,
118  event->val,
119  val_id,
120  event->prev_type,
121  prev_type_id,
122  event->prev_val,
123  prev_val_id,
124  modifier_id,
125  event->keymodifier,
126  flag_id,
127  event->xy[0],
128  event->xy[1],
129  BLI_str_utf8_size(event->utf8_buf),
130  event->utf8_buf,
131  (const void *)event);
132 
133 #ifdef WITH_INPUT_NDOF
134  if (ISNDOF(event->type)) {
135  const wmNDOFMotionData *ndof = event->customdata;
136  if (event->type == NDOF_MOTION) {
137  printf(", ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %u",
138  UNPACK3(ndof->rvec),
139  UNPACK3(ndof->tvec),
140  ndof->dt,
141  ndof->progress);
142  }
143  else {
144  /* ndof buttons printed already */
145  }
146  }
147 #endif /* WITH_INPUT_NDOF */
148 
149  if (event->tablet.active != EVT_TABLET_NONE) {
150  const wmTabletData *wmtab = &event->tablet;
151  printf(", tablet: active: %d, pressure %.4f, tilt: (%.4f %.4f)",
152  wmtab->active,
153  wmtab->pressure,
154  wmtab->x_tilt,
155  wmtab->y_tilt);
156  }
157  printf("\n");
158  }
159  else {
160  printf("wmEvent - NULL\n");
161  }
162 }
163 
166 /* -------------------------------------------------------------------- */
170 bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
171 {
172  /* Keyboard. */
174  if (ISKEYBOARD(event_type)) {
175  return true;
176  }
177  }
179  if (ISKEYMODIFIER(event_type)) {
180  return true;
181  }
182  }
183 
184  /* Mouse. */
185  if (mask & EVT_TYPE_MASK_MOUSE) {
186  if (ISMOUSE(event_type)) {
187  return true;
188  }
189  }
190  else if (mask & EVT_TYPE_MASK_MOUSE_WHEEL) {
191  if (ISMOUSE_WHEEL(event_type)) {
192  return true;
193  }
194  }
195  else if (mask & EVT_TYPE_MASK_MOUSE_GESTURE) {
196  if (ISMOUSE_GESTURE(event_type)) {
197  return true;
198  }
199  }
200 
201  /* NDOF */
202  if (mask & EVT_TYPE_MASK_NDOF) {
203  if (ISNDOF(event_type)) {
204  return true;
205  }
206  }
207 
208  /* Action Zone. */
210  if (IS_EVENT_ACTIONZONE(event_type)) {
211  return true;
212  }
213  }
214 
215  return false;
216 }
217 
220 /* -------------------------------------------------------------------- */
225  const short init_event_type,
226  const short init_event_val)
227 {
228  /* If the release-confirm preference setting is enabled,
229  * drag events can be canceled when mouse is released. */
230  if (U.flag & USER_RELEASECONFIRM) {
231  /* option on, so can exit with km-release */
232  if (event->val == KM_RELEASE) {
233  if ((init_event_val == KM_CLICK_DRAG) && (event->type == init_event_type)) {
234  return 1;
235  }
236  }
237  else {
238  /* If the initial event wasn't a drag event then
239  * ignore #USER_RELEASECONFIRM setting: see T26756. */
240  if (init_event_val != KM_CLICK_DRAG) {
241  return 1;
242  }
243  }
244  }
245  else {
246  /* This is fine as long as not doing km-release, otherwise some items (i.e. markers)
247  * being tweaked may end up getting dropped all over. */
248  if (event->val != KM_RELEASE) {
249  return 1;
250  }
251  }
252 
253  return 0;
254 }
255 
256 bool WM_event_is_mouse_drag(const wmEvent *event)
257 {
258  return (ISMOUSE_BUTTON(event->type) && (event->val == KM_CLICK_DRAG));
259 }
260 
262 {
263  return WM_event_is_mouse_drag(event) ||
264  (ISMOUSE_BUTTON(event->type) && (event->val == KM_PRESS));
265 }
266 
268 {
269  const int delta[2] = {
270  event->xy[0] - event->prev_press_xy[0],
271  event->xy[1] - event->prev_press_xy[1],
272  };
273 
274  int theta = round_fl_to_int(4.0f * atan2f((float)delta[1], (float)delta[0]) / (float)M_PI);
275  int val = KM_DIRECTION_W;
276 
277  if (theta == 0) {
278  val = KM_DIRECTION_E;
279  }
280  else if (theta == 1) {
281  val = KM_DIRECTION_NE;
282  }
283  else if (theta == 2) {
284  val = KM_DIRECTION_N;
285  }
286  else if (theta == 3) {
287  val = KM_DIRECTION_NW;
288  }
289  else if (theta == -1) {
290  val = KM_DIRECTION_SE;
291  }
292  else if (theta == -2) {
293  val = KM_DIRECTION_S;
294  }
295  else if (theta == -3) {
296  val = KM_DIRECTION_SW;
297  }
298 
299 #if 0
300  /* debug */
301  if (val == 1) {
302  printf("tweak north\n");
303  }
304  if (val == 2) {
305  printf("tweak north-east\n");
306  }
307  if (val == 3) {
308  printf("tweak east\n");
309  }
310  if (val == 4) {
311  printf("tweak south-east\n");
312  }
313  if (val == 5) {
314  printf("tweak south\n");
315  }
316  if (val == 6) {
317  printf("tweak south-west\n");
318  }
319  if (val == 7) {
320  printf("tweak west\n");
321  }
322  if (val == 8) {
323  printf("tweak north-west\n");
324  }
325 #endif
326  return val;
327 }
328 
329 bool WM_cursor_test_motion_and_update(const int mval[2])
330 {
331  static int mval_prev[2] = {-1, -1};
332  bool use_cycle = (len_manhattan_v2v2_int(mval, mval_prev) <= WM_EVENT_CURSOR_MOTION_THRESHOLD);
333  copy_v2_v2_int(mval_prev, mval);
334  return !use_cycle;
335 }
336 
339 /* -------------------------------------------------------------------- */
346 int WM_event_drag_threshold(const struct wmEvent *event)
347 {
348  int drag_threshold;
350  if (ISMOUSE_BUTTON(event->prev_press_type)) {
351  /* Using the previous type is important is we want to check the last pressed/released button,
352  * The `event->type` would include #MOUSEMOVE which is always the case when dragging
353  * and does not help us know which threshold to use. */
354  if (WM_event_is_tablet(event)) {
355  drag_threshold = U.drag_threshold_tablet;
356  }
357  else {
358  drag_threshold = U.drag_threshold_mouse;
359  }
360  }
361  else {
362  /* Typically keyboard, could be NDOF button or other less common types. */
363  drag_threshold = U.drag_threshold;
364  }
365  return drag_threshold * U.dpi_fac;
366 }
367 
368 bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
369 {
370  const int drag_threshold = WM_event_drag_threshold(event);
371  return abs(drag_delta[0]) > drag_threshold || abs(drag_delta[1]) > drag_threshold;
372 }
373 
374 bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2])
375 {
376  int drag_delta[2];
377  sub_v2_v2v2_int(drag_delta, prev_xy, event->xy);
378  return WM_event_drag_test_with_delta(event, drag_delta);
379 }
380 
381 void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
382 {
383  const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy;
384  r_mval[0] = xy[0] - region->winrct.xmin;
385  r_mval[1] = xy[1] - region->winrct.ymin;
386 }
387 
388 void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
389 {
390  const int *xy = (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy;
391  r_mval[0] = xy[0] - region->winrct.xmin;
392  r_mval[1] = xy[1] - region->winrct.ymin;
393 }
394 
395 void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
396 {
397  copy_v2_v2_int(r_xy, (event->val == KM_CLICK_DRAG) ? event->prev_press_xy : event->xy);
398 }
399 
402 /* -------------------------------------------------------------------- */
406 char WM_event_utf8_to_ascii(const struct wmEvent *event)
407 {
408  if (BLI_str_utf8_size(event->utf8_buf) == 1) {
409  return event->utf8_buf[0];
410  }
411  return '\0';
412 }
413 
416 /* -------------------------------------------------------------------- */
420 int WM_userdef_event_map(int kmitype)
421 {
422  switch (kmitype) {
423  case WHEELOUTMOUSE:
424  return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
425  case WHEELINMOUSE:
426  return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
427  }
428 
429  return kmitype;
430 }
431 
433 {
434  switch (kmitype) {
435  case WHEELOUTMOUSE:
436  return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
437  case WHEELINMOUSE:
438  return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
439  }
440 
441  return kmitype;
442 }
443 
446 /* -------------------------------------------------------------------- */
450 #ifdef WITH_INPUT_NDOF
451 
452 void WM_event_ndof_pan_get(const wmNDOFMotionData *ndof, float r_pan[3], const bool use_zoom)
453 {
454  int z_flag = use_zoom ? NDOF_ZOOM_INVERT : NDOF_PANZ_INVERT_AXIS;
455  r_pan[0] = ndof->tvec[0] * ((U.ndof_flag & NDOF_PANX_INVERT_AXIS) ? -1.0f : 1.0f);
456  r_pan[1] = ndof->tvec[1] * ((U.ndof_flag & NDOF_PANY_INVERT_AXIS) ? -1.0f : 1.0f);
457  r_pan[2] = ndof->tvec[2] * ((U.ndof_flag & z_flag) ? -1.0f : 1.0f);
458 }
459 
460 void WM_event_ndof_rotate_get(const wmNDOFMotionData *ndof, float r_rot[3])
461 {
462  r_rot[0] = ndof->rvec[0] * ((U.ndof_flag & NDOF_ROTX_INVERT_AXIS) ? -1.0f : 1.0f);
463  r_rot[1] = ndof->rvec[1] * ((U.ndof_flag & NDOF_ROTY_INVERT_AXIS) ? -1.0f : 1.0f);
464  r_rot[2] = ndof->rvec[2] * ((U.ndof_flag & NDOF_ROTZ_INVERT_AXIS) ? -1.0f : 1.0f);
465 }
466 
467 float WM_event_ndof_to_axis_angle(const struct wmNDOFMotionData *ndof, float axis[3])
468 {
469  float angle;
470  angle = normalize_v3_v3(axis, ndof->rvec);
471 
472  axis[0] = axis[0] * ((U.ndof_flag & NDOF_ROTX_INVERT_AXIS) ? -1.0f : 1.0f);
473  axis[1] = axis[1] * ((U.ndof_flag & NDOF_ROTY_INVERT_AXIS) ? -1.0f : 1.0f);
474  axis[2] = axis[2] * ((U.ndof_flag & NDOF_ROTZ_INVERT_AXIS) ? -1.0f : 1.0f);
475 
476  return ndof->dt * angle;
477 }
478 
479 void WM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4])
480 {
481  float axis[3];
482  float angle;
483 
484  angle = WM_event_ndof_to_axis_angle(ndof, axis);
485  axis_angle_to_quat(q, axis, angle);
486 }
487 #endif /* WITH_INPUT_NDOF */
488 
491 /* -------------------------------------------------------------------- */
495 #ifdef WITH_XR_OPENXR
496 bool WM_event_is_xr(const struct wmEvent *event)
497 {
498  return (event->type == EVT_XR_ACTION && event->custom == EVT_DATA_XR);
499 }
500 #endif
501 
504 /* -------------------------------------------------------------------- */
508 float wm_pressure_curve(float pressure)
509 {
510  if (U.pressure_threshold_max != 0.0f) {
511  pressure /= U.pressure_threshold_max;
512  }
513 
514  CLAMP(pressure, 0.0f, 1.0f);
515 
516  if (U.pressure_softness != 0.0f) {
517  pressure = powf(pressure, powf(4.0f, -U.pressure_softness));
518  }
519 
520  return pressure;
521 }
522 
523 float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2])
524 {
525  if (tilt) {
526  tilt[0] = event->tablet.x_tilt;
527  tilt[1] = event->tablet.y_tilt;
528  }
529 
530  if (pen_flip) {
531  (*pen_flip) = (event->tablet.active == EVT_TABLET_ERASER);
532  }
533 
534  return event->tablet.pressure;
535 }
536 
537 bool WM_event_is_tablet(const struct wmEvent *event)
538 {
539  return (event->tablet.active != EVT_TABLET_NONE);
540 }
541 
544 /* -------------------------------------------------------------------- */
552 int WM_event_absolute_delta_x(const struct wmEvent *event)
553 {
554  int dx = event->xy[0] - event->prev_xy[0];
555 
556  if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
557  dx = -dx;
558  }
559 
560  return dx;
561 }
562 
563 int WM_event_absolute_delta_y(const struct wmEvent *event)
564 {
565  int dy = event->xy[1] - event->prev_xy[1];
566 
567  if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
568  dy = -dy;
569  }
570 
571  return dy;
572 }
573 
576 /* -------------------------------------------------------------------- */
580 #ifdef WITH_INPUT_IME
587 bool WM_event_is_ime_switch(const struct wmEvent *event)
588 {
589  return (event->val == KM_PRESS) && (event->type == EVT_SPACEKEY) &&
590  (event->modifier & (KM_CTRL | KM_OSKEY | KM_ALT));
591 }
592 #endif
593 
#define BLI_assert(a)
Definition: BLI_assert.h:46
MINLINE int round_fl_to_int(float a)
#define M_PI
Definition: BLI_math_base.h:20
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])
size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: string.c:120
int BLI_str_utf8_size(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition: string_utf8.c:452
unsigned int uint
Definition: BLI_sys_types.h:67
#define ARRAY_SIZE(arr)
#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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
@ KM_PRESS
Definition: WM_types.h:267
@ KM_CLICK_DRAG
Definition: WM_types.h:275
@ KM_RELEASE
Definition: WM_types.h:268
@ WM_EVENT_FORCE_DRAG_THRESHOLD
Definition: WM_types.h:618
@ WM_EVENT_SCROLL_INVERT
Definition: WM_types.h:606
@ WM_EVENT_IS_REPEAT
Definition: WM_types.h:613
#define WM_EVENT_CURSOR_MOTION_THRESHOLD
Definition: WM_types.h:757
@ KM_CTRL
Definition: WM_types.h:239
@ KM_ALT
Definition: WM_types.h:240
@ KM_OSKEY
Definition: WM_types.h:242
@ KM_SHIFT
Definition: WM_types.h:238
@ KM_DIRECTION_NW
Definition: WM_types.h:291
@ KM_DIRECTION_N
Definition: WM_types.h:284
@ KM_DIRECTION_SW
Definition: WM_types.h:289
@ KM_DIRECTION_NE
Definition: WM_types.h:285
@ KM_DIRECTION_E
Definition: WM_types.h:286
@ KM_DIRECTION_W
Definition: WM_types.h:290
@ KM_DIRECTION_SE
Definition: WM_types.h:287
@ KM_DIRECTION_S
Definition: WM_types.h:288
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define powf(x, y)
Definition: cuda/compat.h:103
#define str(s)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define atan2f(x, y)
Definition: metal/compat.h:227
T abs(const T &a)
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
Definition: rna_access.c:1668
const EnumPropertyItem rna_enum_event_value_items[]
Definition: rna_wm.c:377
const EnumPropertyItem rna_enum_event_type_items[]
Definition: rna_wm.c:145
int ymin
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
short custom
Definition: WM_types.h:712
short val
Definition: WM_types.h:680
short prev_type
Definition: WM_types.h:720
int xy[2]
Definition: WM_types.h:682
char utf8_buf[6]
Definition: WM_types.h:690
short keymodifier
Definition: WM_types.h:702
uint8_t modifier
Definition: WM_types.h:693
wmTabletData tablet
Definition: WM_types.h:705
eWM_EventFlag flag
Definition: WM_types.h:707
short prev_val
Definition: WM_types.h:722
int prev_press_xy[2]
Definition: WM_types.h:738
short type
Definition: WM_types.h:678
short prev_press_type
Definition: WM_types.h:733
float pressure
Definition: WM_types.h:626
float x_tilt
Definition: WM_types.h:628
float y_tilt
Definition: WM_types.h:630
int xy[2]
Definition: wm_draw.c:135
bool WM_event_is_tablet(const struct wmEvent *event)
bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
int WM_event_drag_threshold(const struct wmEvent *event)
int WM_event_drag_direction(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)
float wm_pressure_curve(float pressure)
float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2])
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)
int WM_event_absolute_delta_y(const struct wmEvent *event)
bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
char WM_event_utf8_to_ascii(const struct wmEvent *event)
static void event_ids_from_flag(char *str, const int str_maxlen, const struct FlagIdentifierPair *flag_data, const int flag_data_len, const uint flag)
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])
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)
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_cursor_test_motion_and_update(const int mval[2])
int WM_event_absolute_delta_x(const struct wmEvent *event)
#define ISMOUSE_BUTTON(event_type)
@ EVT_TABLET_NONE
@ EVT_TABLET_ERASER
#define ISMOUSE_WHEEL(event_type)
@ WHEELUPMOUSE
@ EVT_SPACEKEY
@ WHEELDOWNMOUSE
@ MOUSEMOVE
@ NDOF_MOTION
@ WHEELOUTMOUSE
@ WHEELINMOUSE
@ EVT_XR_ACTION
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)
@ EVT_DATA_XR
#define ISNDOF(event_type)
#define ISMOUSE(event_type)