Blender V5.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
10
11#include <cstdlib>
12#include <cstring>
13
14#include "DNA_screen_types.h"
15#include "DNA_userdef_types.h"
17
19#include "BLI_math_vector_c.hh"
20#include "BLI_string.hh"
21#include "BLI_string_utf8.hh"
22#include "BLI_utildefines.hh"
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
34namespace blender {
35
36/* -------------------------------------------------------------------- */
39
41 const char *id;
43};
44
45static void event_ids_from_flag(char *str,
46 const int str_maxncpy,
47 const FlagIdentifierPair *flag_data,
48 const int flag_data_len,
49 const uint flag)
50{
51 int ofs = 0;
52 ofs += BLI_strncpy_rlen(str + ofs, "{", str_maxncpy - ofs);
53 for (int i = 0; i < flag_data_len; i++) {
54 if (flag & flag_data[i].flag) {
55 if (ofs != 1) {
56 ofs += BLI_strncpy_rlen(str + ofs, "|", str_maxncpy - ofs);
57 }
58 ofs += BLI_strncpy_rlen(str + ofs, flag_data[i].id, str_maxncpy - ofs);
59 }
60 }
61 ofs += BLI_strncpy_rlen(str + ofs, "}", str_maxncpy - ofs);
62 UNUSED_VARS(ofs); /* Quiet warning. */
63}
64
65static 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
77void 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 FlagIdentifierPair flag_data[] = {
92 {"SHIFT", KM_SHIFT},
93 {"CTRL", KM_CTRL},
94 {"ALT", KM_ALT},
95 {"OS", KM_OSKEY},
96 {"HYPER", KM_HYPER},
97
98 };
100 modifier_id, sizeof(modifier_id), flag_data, ARRAY_SIZE(flag_data), event->modifier);
101 }
102
103 char flag_id[128];
104 {
105 FlagIdentifierPair flag_data[] = {
106 {"SCROLL_INVERT", WM_EVENT_SCROLL_INVERT},
107 {"IS_REPEAT", WM_EVENT_IS_REPEAT},
108 {"IS_CONSECUTIVE", WM_EVENT_IS_CONSECUTIVE},
109 {"FORCE_DRAG_THRESHOLD", WM_EVENT_FORCE_DRAG_THRESHOLD},
110 };
111 event_ids_from_flag(flag_id, sizeof(flag_id), flag_data, ARRAY_SIZE(flag_data), event->flag);
112 }
113
114 printf(
115 "wmEvent type:%d/%s, val:%d/%s, "
116 "prev_type:%d/%s, prev_val:%d/%s, "
117 "modifier=%s, keymodifier:%d, flag:%s, "
118 "mouse:(%d,%d), utf8:'%.*s', pointer:%p",
119 event->type,
120 type_id,
121 event->val,
122 val_id,
123 event->prev_type,
124 prev_type_id,
125 event->prev_val,
126 prev_val_id,
127 modifier_id,
128 event->keymodifier,
129 flag_id,
130 event->xy[0],
131 event->xy[1],
133 event->utf8_buf,
134 static_cast<const void *>(event));
135
136#ifdef WITH_INPUT_NDOF
137 if (ISNDOF(event->type)) {
138 const wmNDOFMotionData &ndof = *static_cast<const wmNDOFMotionData *>(event->customdata);
139 if (event->type == NDOF_MOTION) {
140 const char *ndof_progress = unknown;
141
142# define CASE_NDOF_PROGRESS(id) \
143 case P_##id: { \
144 ndof_progress = STRINGIFY(id); \
145 break; \
146 }
147 switch (ndof.progress) {
148 CASE_NDOF_PROGRESS(NOT_STARTED);
149 CASE_NDOF_PROGRESS(STARTING);
150 CASE_NDOF_PROGRESS(IN_PROGRESS);
151 CASE_NDOF_PROGRESS(FINISHING);
152 CASE_NDOF_PROGRESS(FINISHED);
153 }
154# undef CASE_NDOF_PROGRESS
155
156 printf(
157 ", ndof: "
158 "rot: (%.4f %.4f %.4f), "
159 "tx: (%.4f %.4f %.4f), "
160 "time_delta: %.4f, "
161 "progress: %s",
162 UNPACK3(ndof.rvec),
163 UNPACK3(ndof.tvec),
164 ndof.time_delta,
165 ndof_progress);
166 }
167 else {
168 /* NDOF buttons printed already. */
169 }
170 }
171#endif /* WITH_INPUT_NDOF */
172
173 if (event->tablet.active != EVT_TABLET_NONE) {
174 const wmTabletData *wmtab = &event->tablet;
175 printf(", tablet: active: %d, pressure %.4f, tilt: (%.4f %.4f)",
176 wmtab->active,
177 wmtab->pressure,
178 wmtab->tilt.x,
179 wmtab->tilt.y);
180 }
181 printf("\n");
182 }
183 else {
184 printf("wmEvent - nullptr\n");
185 }
186}
187
189
190/* -------------------------------------------------------------------- */
193
194bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
195{
196 /* Keyboard. */
198 if (ISKEYBOARD(event_type)) {
199 return true;
200 }
201 }
203 if (ISKEYMODIFIER(event_type)) {
204 return true;
205 }
206 }
207
208 /* Mouse. */
210 if (ISMOUSE(event_type)) {
211 return true;
212 }
213 }
214 else if (mask & EVT_TYPE_MASK_MOUSE_WHEEL) {
215 if (ISMOUSE_WHEEL(event_type)) {
216 return true;
217 }
218 }
220 if (ISMOUSE_GESTURE(event_type)) {
221 return true;
222 }
223 }
224
225 /* NDOF. */
226 if (mask & EVT_TYPE_MASK_NDOF) {
227 if (ISNDOF(event_type)) {
228 return true;
229 }
230 }
231
232 /* Action Zone. */
234 if (IS_EVENT_ACTIONZONE(event_type)) {
235 return true;
236 }
237 }
238
239 return false;
240}
241
243
244/* -------------------------------------------------------------------- */
247
249 const short init_event_type,
250 const short init_event_val)
251{
252 /* If the release-confirm preference setting is enabled,
253 * drag events can be canceled when mouse is released. */
254 if (U.flag & USER_RELEASECONFIRM) {
255 /* Option on, so can exit with km-release. */
256 if (event->val == KM_RELEASE) {
257 if ((init_event_val == KM_PRESS_DRAG) && (event->type == init_event_type)) {
258 return true;
259 }
260 }
261 else {
262 /* If the initial event wasn't a drag event then
263 * ignore #USER_RELEASECONFIRM setting: see #26756. */
264 if (init_event_val != KM_PRESS_DRAG) {
265 return true;
266 }
267 }
268 }
269 else {
270 /* This is fine as long as not doing km-release, otherwise some items (i.e. markers)
271 * being tweaked may end up getting dropped all over. */
272 if (event->val != KM_RELEASE) {
273 return true;
274 }
275 }
276
277 return false;
278}
279
281{
282 return (ISMOUSE_BUTTON(event->type) && (event->val == KM_PRESS_DRAG));
283}
284
286{
287 return WM_event_is_mouse_drag(event) ||
288 (ISMOUSE_BUTTON(event->type) && (event->val == KM_PRESS));
289}
290
292{
293 const int delta[2] = {
294 event->xy[0] - event->prev_press_xy[0],
295 event->xy[1] - event->prev_press_xy[1],
296 };
297
298 int theta = round_fl_to_int(4.0f * atan2f(float(delta[1]), float(delta[0])) / float(M_PI));
299 int val = KM_DIRECTION_W;
300
301 if (theta == 0) {
302 val = KM_DIRECTION_E;
303 }
304 else if (theta == 1) {
305 val = KM_DIRECTION_NE;
306 }
307 else if (theta == 2) {
308 val = KM_DIRECTION_N;
309 }
310 else if (theta == 3) {
311 val = KM_DIRECTION_NW;
312 }
313 else if (theta == -1) {
314 val = KM_DIRECTION_SE;
315 }
316 else if (theta == -2) {
317 val = KM_DIRECTION_S;
318 }
319 else if (theta == -3) {
320 val = KM_DIRECTION_SW;
321 }
322
323#if 0
324 /* Debug. */
325 if (val == 1) {
326 printf("tweak north\n");
327 }
328 if (val == 2) {
329 printf("tweak north-east\n");
330 }
331 if (val == 3) {
332 printf("tweak east\n");
333 }
334 if (val == 4) {
335 printf("tweak south-east\n");
336 }
337 if (val == 5) {
338 printf("tweak south\n");
339 }
340 if (val == 6) {
341 printf("tweak south-west\n");
342 }
343 if (val == 7) {
344 printf("tweak west\n");
345 }
346 if (val == 8) {
347 printf("tweak north-west\n");
348 }
349#endif
350 return val;
351}
352
353bool WM_cursor_test_motion_and_update(const int mval[2])
354{
355 static int mval_prev[2] = {-1, -1};
356 bool use_cycle = (len_manhattan_v2v2_int(mval, mval_prev) <= WM_EVENT_CURSOR_MOTION_THRESHOLD);
357 copy_v2_v2_int(mval_prev, mval);
358 return !use_cycle;
359}
360
362
363/* -------------------------------------------------------------------- */
366
368{
369 return ISMOUSE_GESTURE(event->type) || (event->type == NDOF_MOTION);
370}
371
373{
374 /* Cursor motion breaks the chain. */
375 if (ISMOUSE_MOTION(event->type)) {
376 /* Mouse motion is checked because the user may navigate to a new area
377 * and perform the same gesture - logically it's best to view this as two separate gestures. */
380 {
381 return true;
382 }
383 }
384 else if (ISKEYBOARD_OR_BUTTON(event->type)) {
385 /* Modifiers are excluded because from a user perspective.
386 * For example, releasing a modifier should not begin a new action. */
387 if (!ISKEYMODIFIER(event->type)) {
388 return true;
389 }
390 }
391 else if (event->type == WINDEACTIVATE) {
392 return true;
393 }
394
395 return false;
396}
397
399
400/* -------------------------------------------------------------------- */
406
408{
409 int drag_threshold;
411 if (ISMOUSE_BUTTON(event->prev_press_type)) {
412 /* Using the previous type is important is we want to check the last pressed/released button,
413 * The `event->type` would include #MOUSEMOVE which is always the case when dragging
414 * and does not help us know which threshold to use. */
415 if (WM_event_is_tablet(event)) {
416 drag_threshold = U.drag_threshold_tablet;
417 }
418 else {
419 drag_threshold = U.drag_threshold_mouse;
420 }
421 }
422 else {
423 /* Typically keyboard, could be NDOF button or other less common types. */
424 drag_threshold = U.drag_threshold;
425 }
426 return drag_threshold * UI_SCALE_FAC;
427}
428
429bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
430{
431 const int drag_threshold = WM_event_drag_threshold(event);
432 return abs(drag_delta[0]) > drag_threshold || abs(drag_delta[1]) > drag_threshold;
433}
434
435bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2])
436{
437 int drag_delta[2];
438 sub_v2_v2v2_int(drag_delta, prev_xy, event->xy);
439 return WM_event_drag_test_with_delta(event, drag_delta);
440}
441
442void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
443{
444 const int *xy = (event->val == KM_PRESS_DRAG) ? event->prev_press_xy : event->xy;
445 r_mval[0] = xy[0] - region->winrct.xmin;
446 r_mval[1] = xy[1] - region->winrct.ymin;
447}
448
449void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
450{
451 const int *xy = (event->val == KM_PRESS_DRAG) ? event->prev_press_xy : event->xy;
452 r_mval[0] = xy[0] - region->winrct.xmin;
453 r_mval[1] = xy[1] - region->winrct.ymin;
454}
455
456void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
457{
458 copy_v2_v2_int(r_xy, (event->val == KM_PRESS_DRAG) ? event->prev_press_xy : event->xy);
459}
460
462
463/* -------------------------------------------------------------------- */
466
468{
469 if (BLI_str_utf8_size_or_error(event->utf8_buf) == 1) {
470 return event->utf8_buf[0];
471 }
472 return '\0';
473}
474
476
477/* -------------------------------------------------------------------- */
480
481int WM_userdef_event_map(int kmitype)
482{
483 switch (kmitype) {
484 case WHEELOUTMOUSE:
485 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
486 case WHEELINMOUSE:
487 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
488 }
489
490 return kmitype;
491}
492
494{
495 switch (kmitype) {
496 case WHEELOUTMOUSE:
497 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELUPMOUSE : WHEELDOWNMOUSE;
498 case WHEELINMOUSE:
499 return (U.uiflag & USER_WHEELZOOMDIR) ? WHEELDOWNMOUSE : WHEELUPMOUSE;
500 }
501
502 return kmitype;
503}
504
506
507/* -------------------------------------------------------------------- */
510
511#ifdef WITH_INPUT_NDOF
512
513static float3 event_ndof_translation_get_with_sign(const wmNDOFMotionData &ndof, const float sign)
514{
515 int ndof_flag = U.ndof_flag;
516 int x = 0, y = 1, z = 2;
517 if (ndof_flag & NDOF_SWAP_YZ_AXIS) {
518 /* Map `{x, y, z}` -> `{x, -z, y}`. */
519 std::swap(y, z);
520 ndof_flag ^= NDOF_PANY_INVERT_AXIS;
521 }
522 return {
523 ndof.tvec[x] * ((ndof_flag & NDOF_PANX_INVERT_AXIS) ? -sign : sign),
524 ndof.tvec[y] * ((ndof_flag & NDOF_PANY_INVERT_AXIS) ? -sign : sign),
525 ndof.tvec[z] * ((ndof_flag & NDOF_PANZ_INVERT_AXIS) ? -sign : sign),
526 };
527}
528
529static float3 event_ndof_rotation_get_with_sign(const wmNDOFMotionData &ndof, const float sign)
530{
531 int ndof_flag = U.ndof_flag;
532 int x = 0, y = 1, z = 2;
533 if (ndof_flag & NDOF_SWAP_YZ_AXIS) {
534 /* Map `{x, y, z}` -> `{x, -z, y}`. */
535 std::swap(y, z);
536 ndof_flag ^= NDOF_ROTY_INVERT_AXIS;
537 }
538 return {
539 ndof.rvec[x] * ((ndof_flag & NDOF_ROTX_INVERT_AXIS) ? -sign : sign),
540 ndof.rvec[y] * ((ndof_flag & NDOF_ROTY_INVERT_AXIS) ? -sign : sign),
541 ndof.rvec[z] * ((ndof_flag & NDOF_ROTZ_INVERT_AXIS) ? -sign : sign),
542 };
543}
544
545float3 WM_event_ndof_translation_get_for_navigation(const wmNDOFMotionData &ndof)
546{
547 const float sign = (U.ndof_navigation_mode == NDOF_NAVIGATION_MODE_OBJECT) ? -1.0f : 1.0f;
548 return event_ndof_translation_get_with_sign(ndof, sign);
549}
550
551float3 WM_event_ndof_rotation_get_for_navigation(const wmNDOFMotionData &ndof)
552{
553 const float sign = (U.ndof_navigation_mode == NDOF_NAVIGATION_MODE_OBJECT) ? -1.0f : 1.0f;
554 return event_ndof_rotation_get_with_sign(ndof, sign);
555}
556
557float3 WM_event_ndof_translation_get(const wmNDOFMotionData &ndof)
558{
559 return event_ndof_translation_get_with_sign(ndof, 1.0f);
560}
561
562float3 WM_event_ndof_rotation_get(const wmNDOFMotionData &ndof)
563{
564 return event_ndof_rotation_get_with_sign(ndof, 1.0f);
565}
566
567float WM_event_ndof_rotation_get_axis_angle_for_navigation(const wmNDOFMotionData &ndof,
568 float axis[3])
569{
570 const float3 rvec = WM_event_ndof_rotation_get_for_navigation(ndof);
571 return normalize_v3_v3(axis, rvec);
572}
573
574float WM_event_ndof_rotation_get_axis_angle(const wmNDOFMotionData &ndof, float axis[3])
575{
576 const float3 rvec = WM_event_ndof_rotation_get(ndof);
577 return normalize_v3_v3(axis, rvec);
578}
579
580bool WM_event_ndof_translation_has_pan(const wmNDOFMotionData &ndof)
581{
582 return (U.ndof_flag & NDOF_SWAP_YZ_AXIS) ? ((ndof.tvec[0] != 0.0f) || (ndof.tvec[2] != 0.0f)) :
583 ((ndof.tvec[0] != 0.0f) || (ndof.tvec[1] != 0.0f));
584}
585
586bool WM_event_ndof_translation_has_zoom(const wmNDOFMotionData &ndof)
587{
588 return ndof.tvec[(U.ndof_flag & NDOF_SWAP_YZ_AXIS) ? 1 : 2] != 0.0f;
589}
590
591#endif /* WITH_INPUT_NDOF */
592
594
595/* -------------------------------------------------------------------- */
598
599#ifdef WITH_XR_OPENXR
600bool WM_event_is_xr(const wmEvent *event)
601{
602 return (event->type == EVT_XR_ACTION && event->custom == EVT_DATA_XR);
603}
604#endif
605
607
608/* -------------------------------------------------------------------- */
611
612float wm_pressure_curve(float raw_pressure)
613{
614 if (U.pressure_threshold_max != 0.0f) {
615 raw_pressure /= U.pressure_threshold_max;
616 }
617
618 CLAMP(raw_pressure, 0.0f, 1.0f);
619
620 if (U.pressure_softness != 0.0f) {
621 raw_pressure = powf(raw_pressure, powf(4.0f, -U.pressure_softness));
622 }
623
624 return raw_pressure;
625}
626
627float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])
628{
629 if (r_tilt) {
630 copy_v2_v2(r_tilt, event->tablet.tilt);
631 }
632
633 if (r_pen_flip) {
634 (*r_pen_flip) = (event->tablet.active == EVT_TABLET_ERASER);
635 }
636
637 return event->tablet.pressure;
638}
639
640bool WM_event_is_tablet(const wmEvent *event)
641{
642 return (event->tablet.active != EVT_TABLET_NONE);
643}
644
646
647/* -------------------------------------------------------------------- */
654
656{
657 int dx = event->xy[0] - event->prev_xy[0];
658
659 if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
660 dx = -dx;
661 }
662
663 return dx;
664}
665
667{
668 int dy = event->xy[1] - event->prev_xy[1];
669
670 if ((event->flag & WM_EVENT_SCROLL_INVERT) == 0) {
671 dy = -dy;
672 }
673
674 return dy;
675}
676
678
679/* -------------------------------------------------------------------- */
682
683#ifdef WITH_INPUT_IME
684bool WM_event_is_ime_switch(const wmEvent *event)
685{
686 /* Most OS's use `Ctrl+Space` / `OsKey+Space` to switch IME,
687 * so don't type in the space character.
688 *
689 * NOTE: Shift is excluded from this check since it prevented typing `Shift+Space`, see: #85517.
690 */
691 return (event->val == KM_PRESS) && (event->type == EVT_SPACEKEY) &&
692 (event->modifier & (KM_CTRL | KM_OSKEY | KM_ALT));
693}
694#endif
695
697
698} // namespace blender
#define M_PI
#define UI_SCALE_FAC
#define WM_EVENT_CURSOR_MOTION_THRESHOLD
Definition WM_types.hh:904
#define U
#define CLAMP(a, b, c)
#define UNUSED_VARS(...)
#define UNPACK3(a)
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
#define powf(x, y)
#define str(s)
constexpr T sign(T) RET
#define abs
BMesh Iterators.
UserDef U
Definition blender.cc:58
bool WM_event_consecutive_gesture_test(const wmEvent *event)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool WM_event_is_modal_drag_exit(const wmEvent *event, const short init_event_type, const short init_event_val)
float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])
int WM_event_absolute_delta_x(const wmEvent *event)
@ KM_DIRECTION_E
Definition WM_types.hh:349
@ KM_DIRECTION_N
Definition WM_types.hh:347
@ KM_DIRECTION_SW
Definition WM_types.hh:352
@ KM_DIRECTION_S
Definition WM_types.hh:351
@ KM_DIRECTION_SE
Definition WM_types.hh:350
@ KM_DIRECTION_NW
Definition WM_types.hh:354
@ KM_DIRECTION_NE
Definition WM_types.hh:348
@ KM_DIRECTION_W
Definition WM_types.hh:353
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2])
unsigned int uint
Definition BKE_text.h:55
bool WM_event_type_mask_test(const int event_type, const enum eEventType_Mask mask)
MINLINE int round_fl_to_int(float a)
MINLINE void copy_v2_v2(float r[2], const float a[2])
const EnumPropertyItem rna_enum_event_value_items[]
Definition rna_wm.cc:488
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2])
char WM_event_utf8_to_ascii(const wmEvent *event)
MINLINE int len_manhattan_v2v2_int(const int a[2], const int b[2]) ATTR_WARN_UNUSED_RESULT
void WM_event_print(const wmEvent *event)
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_threshold(const wmEvent *event)
MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2])
bool WM_event_is_tablet(const wmEvent *event)
int WM_event_drag_direction(const wmEvent *event)
@ WM_EVENT_SCROLL_INVERT
Definition WM_types.hh:737
@ WM_EVENT_FORCE_DRAG_THRESHOLD
Definition WM_types.hh:757
@ WM_EVENT_IS_CONSECUTIVE
Definition WM_types.hh:752
@ WM_EVENT_IS_REPEAT
Definition WM_types.hh:744
bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2])
const EnumPropertyItem rna_enum_event_type_items[]
Definition rna_wm.cc:225
float wm_pressure_curve(float raw_pressure)
bool WM_event_is_mouse_drag(const wmEvent *event)
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
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
@ EVT_TYPE_MASK_ACTIONZONE
@ EVT_TYPE_MASK_MOUSE_GESTURE
@ EVT_TYPE_MASK_KEYBOARD_MODIFIER
@ EVT_TYPE_MASK_KEYBOARD
@ EVT_TYPE_MASK_MOUSE_WHEEL
int WM_userdef_event_map(int kmitype)
const char int BLI_str_utf8_size_or_error(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
static void event_ids_from_type_and_value(const short type, const short val, const char **r_type_id, const char **r_val_id)
MINLINE float normalize_v3_v3(float r[3], const float a[3])
@ NDOF_NAVIGATION_MODE_OBJECT
int WM_event_absolute_delta_y(const wmEvent *event)
@ KM_PRESS_DRAG
Definition WM_types.hh:332
@ KM_RELEASE
Definition WM_types.hh:325
bool WM_event_consecutive_gesture_test_break(const wmWindow *win, const wmEvent *event)
bool WM_cursor_test_motion_and_update(const int mval[2])
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
VecBase< float, 3 > float3
bool WM_event_is_mouse_drag_or_press(const wmEvent *event)
int WM_userdef_event_type_from_keymap_type(int kmitype)
bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2])
#define atan2f
wmEventType prev_press_type
Definition WM_types.hh:885
eWM_EventFlag flag
Definition WM_types.hh:848
wmTabletData tablet
Definition WM_types.hh:846
int prev_press_xy[2]
Definition WM_types.hh:890
wmEventType keymodifier
Definition WM_types.hh:843
wmEventType type
Definition WM_types.hh:817
wmEventType prev_type
Definition WM_types.hh:872
wmEventModifierFlag modifier
Definition WM_types.hh:834
#define ISMOUSE_BUTTON(event_type)
#define ISKEYBOARD_OR_BUTTON(event_type)
#define ISMOUSE_MOTION(event_type)
#define ISMOUSE_WHEEL(event_type)
#define ISKEYMODIFIER(event_type)
#define IS_EVENT_ACTIONZONE(event_type)
#define ISMOUSE_GESTURE(event_type)
#define ISKEYBOARD(event_type)
#define ISNDOF(event_type)
#define ISMOUSE(event_type)