59 const char **r_type_id,
60 const char **r_val_id)
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;
88 "wmEvent type:%d / %s, val:%d / %s,\n"
89 " prev_type:%d / %s, prev_val:%d / %s,\n"
90 " shift:%d, ctrl:%d, alt:%d, oskey:%d, keymodifier:%d, is_repeat:%d,\n"
91 " mouse:(%d,%d), ascii:'%c', utf8:'%.*s', pointer:%p\n",
111 (
const void *)event);
113 #ifdef WITH_INPUT_NDOF
114 if (
ISNDOF(event->type)) {
115 const wmNDOFMotionData *ndof =
event->customdata;
117 printf(
" ndof: rot: (%.4f %.4f %.4f), tx: (%.4f %.4f %.4f), dt: %.4f, progress: %u\n",
131 printf(
" tablet: active: %d, pressure %.4f, tilt: (%.4f %.4f)\n",
139 printf(
"wmEvent - NULL\n");
230 switch (tweak_event) {
260 while ((event = event->
next)) {
286 drag_threshold =
U.drag_threshold_tablet;
293 drag_threshold =
U.drag_threshold_mouse;
297 drag_threshold =
U.drag_threshold;
299 return drag_threshold *
U.dpi_fac;
305 return abs(drag_delta[0]) > drag_threshold ||
abs(drag_delta[1]) > drag_threshold;
310 const int drag_delta[2] = {
311 prev_xy[0] -
event->x,
312 prev_xy[1] -
event->y,
364 #ifdef WITH_INPUT_NDOF
366 void WM_event_ndof_pan_get(
const wmNDOFMotionData *ndof,
float r_pan[3],
const bool use_zoom)
371 r_pan[2] = ndof->tvec[2] * ((
U.ndof_flag & z_flag) ? -1.0f : 1.0f);
374 void WM_event_ndof_rotate_get(
const wmNDOFMotionData *ndof,
float r_rot[3])
381 float WM_event_ndof_to_axis_angle(
const struct wmNDOFMotionData *ndof,
float axis[3])
390 return ndof->dt *
angle;
393 void WM_event_ndof_to_quat(
const struct wmNDOFMotionData *ndof,
float q[4])
398 angle = WM_event_ndof_to_axis_angle(ndof, axis);
412 if (
U.pressure_threshold_max != 0.0f) {
413 pressure /=
U.pressure_threshold_max;
416 CLAMP(pressure, 0.0f, 1.0f);
418 if (
U.pressure_softness != 0.0f) {
419 pressure =
powf(pressure,
powf(4.0f, -
U.pressure_softness));
430 tilt[0] =
event->tablet.x_tilt;
431 tilt[1] =
event->tablet.y_tilt;
438 return event->tablet.pressure;
458 int dx =
event->x -
event->prevx;
469 int dy =
event->y -
event->prevy;
484 #ifdef WITH_INPUT_IME
486 bool WM_event_is_ime_switch(
const struct wmEvent *event)
489 (
event->ctrl ||
event->oskey ||
event->alt);
void axis_angle_to_quat(float r[4], const float axis[3], const float angle)
MINLINE float normalize_v3_v3(float r[3], const float a[3])
int BLI_str_utf8_size(const char *p) ATTR_NONNULL()
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 RGB to Bright Vector Camera CLAMP
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
const EnumPropertyItem rna_enum_event_value_all_items[]
const EnumPropertyItem rna_enum_event_value_tweak_items[]
const EnumPropertyItem rna_enum_event_type_items[]
char is_direction_inverted
__forceinline const avxi abs(const avxi &a)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
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)
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])
bool WM_event_is_mouse_drag(const wmEvent *event)
bool WM_event_is_modal_tweak_exit(const wmEvent *event, int tweak_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)
bool WM_event_is_last_mousemove(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)
int WM_event_absolute_delta_x(const struct wmEvent *event)
int WM_event_modifier_flag(const wmEvent *event)
#define ISMOUSE_BUTTON(event_type)
#define ISTWEAK(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)