|
Blender
V2.93
|
#include <stdlib.h>#include <string.h>#include "DNA_listBase.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_userdef_types.h"#include "DNA_windowmanager_types.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "RNA_access.h"#include "WM_api.h"#include "WM_types.h"#include "wm_event_system.h"#include "wm_event_types.h"#include "RNA_enum_types.h"#include "DEG_depsgraph.h"Go to the source code of this file.
Functions | |
Event Printing | |
| static void | event_ids_from_type_and_value (const short type, const short val, const char **r_type_id, const char **r_val_id) |
| void | WM_event_print (const wmEvent *event) |
Event Modifier/Type Queries | |
| int | WM_event_modifier_flag (const wmEvent *event) |
| bool | WM_event_type_mask_test (const int event_type, const enum eEventType_Mask mask) |
Event Motion Queries | |
| bool | WM_event_is_modal_tweak_exit (const wmEvent *event, int tweak_event) |
| bool | WM_event_is_last_mousemove (const wmEvent *event) |
| bool | WM_event_is_mouse_drag (const wmEvent *event) |
Event Click/Drag Checks | |
Values under this limit are detected as clicks. | |
| int | WM_event_drag_threshold (const struct wmEvent *event) |
| bool | WM_event_drag_test_with_delta (const wmEvent *event, const int drag_delta[2]) |
| bool | WM_event_drag_test (const wmEvent *event, const int prev_xy[2]) |
Event Preference Mapping | |
| int | WM_userdef_event_map (int kmitype) |
| int | WM_userdef_event_type_from_keymap_type (int kmitype) |
Event Tablet Input Access | |
| float | wm_pressure_curve (float pressure) |
| float | WM_event_tablet_data (const wmEvent *event, int *pen_flip, float tilt[2]) |
| bool | WM_event_is_tablet (const struct wmEvent *event) |
Event Scroll's Absolute Deltas | |
User may change the scroll behavior, and the deltas are automatically inverted. These functions return the absolute direction, swipe up/right gives positive values. | |
| int | WM_event_absolute_delta_x (const struct wmEvent *event) |
| int | WM_event_absolute_delta_y (const struct wmEvent *event) |
Read-only queries utility functions for the event system.
Definition in file wm_event_query.c.
|
static |
Definition at line 57 of file wm_event_query.c.
References ISTWEAK, rna_enum_event_type_items, rna_enum_event_value_all_items, rna_enum_event_value_tweak_items, RNA_enum_identifier(), and type.
Referenced by WM_event_print().
| int WM_event_absolute_delta_x | ( | const struct wmEvent * | event | ) |
Definition at line 456 of file wm_event_query.c.
References wmEvent::is_direction_inverted.
Referenced by view_zoomdrag_invoke().
| int WM_event_absolute_delta_y | ( | const struct wmEvent * | event | ) |
Definition at line 467 of file wm_event_query.c.
References wmEvent::is_direction_inverted.
Referenced by ui_pan_to_scroll(), and view_zoomdrag_invoke().
| bool WM_event_drag_test | ( | const wmEvent * | event, |
| const int | prev_xy[2] | ||
| ) |
Definition at line 308 of file wm_event_query.c.
References WM_event_drag_test_with_delta().
Referenced by wm_event_is_double_click(), and wm_handlers_do().
| bool WM_event_drag_test_with_delta | ( | const wmEvent * | event, |
| const int | drag_delta[2] | ||
| ) |
Definition at line 302 of file wm_event_query.c.
References abs(), and WM_event_drag_threshold().
Referenced by WM_event_drag_test(), WM_generic_select_modal(), and wm_gesture_evaluate().
| int WM_event_drag_threshold | ( | const struct wmEvent * | event | ) |
Definition at line 282 of file wm_event_query.c.
References BLI_assert, ISMOUSE, MOUSEMOVE, wmEvent::prevtype, and WM_event_is_tablet().
Referenced by ui_but_drag_init(), and WM_event_drag_test_with_delta().
| bool WM_event_is_last_mousemove | ( | const wmEvent * | event | ) |
Definition at line 258 of file wm_event_query.c.
References ELEM, INBETWEEN_MOUSEMOVE, MOUSEMOVE, wmEvent::next, and wmEvent::type.
Referenced by walkEvent().
| bool WM_event_is_modal_tweak_exit | ( | const wmEvent * | event, |
| int | tweak_event | ||
| ) |
Definition at line 222 of file wm_event_query.c.
References ELEM, EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R, KM_RELEASE, USER_RELEASECONFIRM, and wmEvent::val.
Referenced by ed_marker_move_modal().
| bool WM_event_is_mouse_drag | ( | const wmEvent * | event | ) |
Definition at line 268 of file wm_event_query.c.
References ISMOUSE_BUTTON, ISTWEAK, KM_CLICK_DRAG, and wmEvent::type.
Referenced by gizmo_tweak_invoke().
| bool WM_event_is_tablet | ( | const struct wmEvent * | event | ) |
Definition at line 441 of file wm_event_query.c.
References wmTabletData::active, EVT_TABLET_NONE, and wmEvent::tablet.
Referenced by paint_stroke_modal(), and WM_event_drag_threshold().
| int WM_event_modifier_flag | ( | const wmEvent * | event | ) |
Definition at line 149 of file wm_event_query.c.
References wmEvent::alt, wmEvent::ctrl, KM_ALT, KM_CTRL, KM_OSKEY, KM_SHIFT, wmEvent::oskey, and wmEvent::shift.
Referenced by gizmo_preselect_elem_test_select(), and wm_gizmomap_highlight_find().
| void WM_event_print | ( | const wmEvent * | event | ) |
Definition at line 75 of file wm_event_query.c.
References wmTabletData::active, wmEvent::alt, wmEvent::ascii, BLI_str_utf8_size(), wmEvent::ctrl, event_ids_from_type_and_value(), EVT_TABLET_NONE, wmEvent::is_repeat, ISNDOF, wmEvent::keymodifier, NDOF_MOTION, wmEvent::oskey, wmTabletData::pressure, wmEvent::prevtype, wmEvent::prevval, wmEvent::shift, wmEvent::type, UNPACK3, wmEvent::utf8_buf, wmEvent::val, wmEvent::x, wmTabletData::x_tilt, wmEvent::y, and wmTabletData::y_tilt.
Referenced by wm_event_add_ghostevent(), wm_event_do_handlers(), and wm_event_free().
Definition at line 427 of file wm_event_query.c.
References EVT_TABLET_ERASER.
Referenced by paint_stroke_modal().
| bool WM_event_type_mask_test | ( | const int | event_type, |
| const enum eEventType_Mask | mask | ||
| ) |
Definition at line 167 of file wm_event_query.c.
References EVT_TYPE_MASK_ACTIONZONE, EVT_TYPE_MASK_KEYBOARD, EVT_TYPE_MASK_KEYBOARD_MODIFIER, EVT_TYPE_MASK_MOUSE, EVT_TYPE_MASK_MOUSE_GESTURE, EVT_TYPE_MASK_MOUSE_WHEEL, EVT_TYPE_MASK_TWEAK, IS_EVENT_ACTIONZONE, ISKEYBOARD, ISKEYMODIFIER, ISMOUSE, ISMOUSE_GESTURE, ISMOUSE_WHEEL, ISTWEAK, and mask().
Referenced by kmi_filter_is_visible_type_mask().
Definition at line 410 of file wm_event_query.c.
Referenced by wm_tablet_data_from_ghost().
| int WM_userdef_event_map | ( | int | kmitype | ) |
Definition at line 323 of file wm_event_query.c.
References USER_WHEELZOOMDIR, WHEELDOWNMOUSE, WHEELINMOUSE, WHEELOUTMOUSE, and WHEELUPMOUSE.
Referenced by wm_eventmatch(), and WM_keymap_item_compare().
| int WM_userdef_event_type_from_keymap_type | ( | int | kmitype | ) |
Use so we can check if 'wmEvent.type' is released in modal operators.
An alternative would be to add a 'wmEvent.type_nokeymap'... or similar.
Definition at line 340 of file wm_event_query.c.
References EVT_TWEAK_L, EVT_TWEAK_M, EVT_TWEAK_R, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE, USER_WHEELZOOMDIR, WHEELDOWNMOUSE, WHEELINMOUSE, WHEELOUTMOUSE, and WHEELUPMOUSE.
Referenced by edbm_bevel_invoke(), edbm_inset_invoke(), gizmo_tweak_invoke(), image_view_pan_init(), image_view_zoom_init(), initTransform(), object_transform_axis_target_invoke(), op_generic_value_invoke(), radial_control_invoke(), sample_color_invoke(), slide_plane_marker_customdata(), stencil_control_invoke(), view3d_interactive_add_begin(), view_pan_init(), and view_zoom_init().