Blender  V2.93
wm_event_query.c File Reference
#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)
 

Detailed Description

Read-only queries utility functions for the event system.

Definition in file wm_event_query.c.

Function Documentation

◆ event_ids_from_type_and_value()

static void event_ids_from_type_and_value ( const short  type,
const short  val,
const char **  r_type_id,
const char **  r_val_id 
)
static

◆ WM_event_absolute_delta_x()

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().

◆ WM_event_absolute_delta_y()

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().

◆ WM_event_drag_test()

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().

◆ WM_event_drag_test_with_delta()

bool WM_event_drag_test_with_delta ( const wmEvent event,
const int  drag_delta[2] 
)

◆ WM_event_drag_threshold()

int WM_event_drag_threshold ( const struct wmEvent event)

◆ WM_event_is_last_mousemove()

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().

◆ WM_event_is_modal_tweak_exit()

bool WM_event_is_modal_tweak_exit ( const wmEvent event,
int  tweak_event 
)

◆ WM_event_is_mouse_drag()

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().

◆ WM_event_is_tablet()

bool WM_event_is_tablet ( const struct wmEvent event)

◆ WM_event_modifier_flag()

int WM_event_modifier_flag ( const wmEvent event)

◆ WM_event_print()

void WM_event_print ( const wmEvent event)

◆ WM_event_tablet_data()

float WM_event_tablet_data ( const wmEvent event,
int *  pen_flip,
float  tilt[2] 
)

Definition at line 427 of file wm_event_query.c.

References EVT_TABLET_ERASER.

Referenced by paint_stroke_modal().

◆ WM_event_type_mask_test()

bool WM_event_type_mask_test ( const int  event_type,
const enum eEventType_Mask  mask 
)

◆ wm_pressure_curve()

float wm_pressure_curve ( float  pressure)

Definition at line 410 of file wm_event_query.c.

References CLAMP, and powf.

Referenced by wm_tablet_data_from_ghost().

◆ WM_userdef_event_map()

int WM_userdef_event_map ( int  kmitype)

◆ WM_userdef_event_type_from_keymap_type()

int WM_userdef_event_type_from_keymap_type ( int  kmitype)