49 const int flag_data_len,
54 for (
int i = 0; i < flag_data_len; i++) {
55 if (flag & flag_data[i].flag) {
67 const char **r_type_id,
68 const char **r_val_id)
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;
89 char modifier_id[128];
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",
131 (
const void *)event);
133 #ifdef WITH_INPUT_NDOF
134 if (
ISNDOF(event->type)) {
135 const wmNDOFMotionData *ndof =
event->customdata;
137 printf(
", ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %u",
151 printf(
", tablet: active: %d, pressure %.4f, tilt: (%.4f %.4f)",
160 printf(
"wmEvent - NULL\n");
225 const short init_event_type,
226 const short init_event_val)
269 const int delta[2] = {
270 event->xy[0] -
event->prev_press_xy[0],
271 event->xy[1] -
event->prev_press_xy[1],
280 else if (theta == 1) {
283 else if (theta == 2) {
286 else if (theta == 3) {
289 else if (theta == -1) {
292 else if (theta == -2) {
295 else if (theta == -3) {
302 printf(
"tweak north\n");
305 printf(
"tweak north-east\n");
308 printf(
"tweak east\n");
311 printf(
"tweak south-east\n");
314 printf(
"tweak south\n");
317 printf(
"tweak south-west\n");
320 printf(
"tweak west\n");
323 printf(
"tweak north-west\n");
331 static int mval_prev[2] = {-1, -1};
355 drag_threshold =
U.drag_threshold_tablet;
358 drag_threshold =
U.drag_threshold_mouse;
363 drag_threshold =
U.drag_threshold;
365 return drag_threshold *
U.dpi_fac;
371 return abs(drag_delta[0]) > drag_threshold ||
abs(drag_delta[1]) > drag_threshold;
409 return event->utf8_buf[0];
450 #ifdef WITH_INPUT_NDOF
452 void WM_event_ndof_pan_get(
const wmNDOFMotionData *ndof,
float r_pan[3],
const bool use_zoom)
457 r_pan[2] = ndof->tvec[2] * ((
U.ndof_flag & z_flag) ? -1.0f : 1.0f);
460 void WM_event_ndof_rotate_get(
const wmNDOFMotionData *ndof,
float r_rot[3])
467 float WM_event_ndof_to_axis_angle(
const struct wmNDOFMotionData *ndof,
float axis[3])
476 return ndof->dt *
angle;
479 void WM_event_ndof_to_quat(
const struct wmNDOFMotionData *ndof,
float q[4])
484 angle = WM_event_ndof_to_axis_angle(ndof, axis);
495 #ifdef WITH_XR_OPENXR
496 bool WM_event_is_xr(
const struct wmEvent *event)
510 if (
U.pressure_threshold_max != 0.0f) {
511 pressure /=
U.pressure_threshold_max;
514 CLAMP(pressure, 0.0f, 1.0f);
516 if (
U.pressure_softness != 0.0f) {
517 pressure =
powf(pressure,
powf(4.0f, -
U.pressure_softness));
526 tilt[0] =
event->tablet.x_tilt;
527 tilt[1] =
event->tablet.y_tilt;
534 return event->tablet.pressure;
554 int dx =
event->xy[0] -
event->prev_xy[0];
565 int dy =
event->xy[1] -
event->prev_xy[1];
580 #ifdef WITH_INPUT_IME
587 bool WM_event_is_ime_switch(
const struct wmEvent *event)
MINLINE int round_fl_to_int(float a)
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()
int BLI_str_utf8_size(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
These structs are the foundation for all linked lists in the library system.
_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
@ WM_EVENT_FORCE_DRAG_THRESHOLD
#define WM_EVENT_CURSOR_MOTION_THRESHOLD
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
const EnumPropertyItem rna_enum_event_value_items[]
const EnumPropertyItem rna_enum_event_type_items[]
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)
#define ISMOUSE_WHEEL(event_type)
@ EVT_TYPE_MASK_ACTIONZONE
@ EVT_TYPE_MASK_KEYBOARD_MODIFIER
@ EVT_TYPE_MASK_MOUSE_WHEEL
@ EVT_TYPE_MASK_MOUSE_GESTURE
#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)