Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_markers.c6
-rw-r--r--source/blender/editors/animation/anim_ops.c6
-rw-r--r--source/blender/editors/armature/pose_lib.c88
-rw-r--r--source/blender/editors/armature/pose_slide.c22
-rw-r--r--source/blender/editors/curve/editcurve_paint.c2
-rw-r--r--source/blender/editors/curve/editfont.c4
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c30
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c42
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c42
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c32
-rw-r--r--source/blender/editors/gpencil/gpencil_uv.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c32
-rw-r--r--source/blender/editors/gpencil/gpencil_weight_paint.c32
-rw-r--r--source/blender/editors/interface/interface_context_menu.c2
-rw-r--r--source/blender/editors/interface/interface_handlers.c316
-rw-r--r--source/blender/editors/interface/interface_icons.c108
-rw-r--r--source/blender/editors/interface/interface_icons_event.c44
-rw-r--r--source/blender/editors/interface/interface_panel.c19
-rw-r--r--source/blender/editors/interface/interface_region_search.c4
-rw-r--r--source/blender/editors/interface/view2d_ops.c4
-rw-r--r--source/blender/editors/mask/mask_ops.c28
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c20
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c14
-rw-r--r--source/blender/editors/object/object_bake.c2
-rw-r--r--source/blender/editors/object/object_bake_api.c2
-rw-r--r--source/blender/editors/object/object_transform.c4
-rw-r--r--source/blender/editors/physics/physics_fluid.c2
-rw-r--r--source/blender/editors/render/render_internal.c2
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/render/render_shading.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c8
-rw-r--r--source/blender/editors/space_clip/clip_ops.c8
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c16
-rw-r--r--source/blender/editors/space_clip/tracking_ops_plane.c12
-rw-r--r--source/blender/editors/space_clip/tracking_ops_solve.c2
-rw-r--r--source/blender/editors/space_clip/tracking_ops_track.c2
-rw-r--r--source/blender/editors/space_graph/graph_edit.c6
-rw-r--r--source/blender/editors/space_graph/graph_ops.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c10
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c24
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/transform/transform.c72
-rw-r--r--source/blender/editors/transform/transform_input.c4
-rw-r--r--source/blender/editors/transform/transform_mode_edge_slide.c6
-rw-r--r--source/blender/editors/transform/transform_mode_shear.c4
-rw-r--r--source/blender/editors/transform/transform_mode_vert_slide.c6
-rw-r--r--source/blender/editors/util/numinput.c30
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c20
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c10
55 files changed, 612 insertions, 583 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 93cb2d1e306..4e2b126e2fb 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -965,7 +965,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
else {
bool handled = false;
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
ed_marker_move_cancel(C, op);
return OPERATOR_CANCELLED;
case RIGHTMOUSE:
@@ -977,8 +977,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
/* else continue; <--- see if release event should be caught for tweak-end */
ATTR_FALLTHROUGH;
- case RETKEY:
- case PADENTER:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
case LEFTMOUSE:
case MIDDLEMOUSE:
if (WM_event_is_modal_tweak_exit(event, mm->event_type)) {
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index fb045abe016..a85ec8a5d14 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -215,7 +215,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
int ret = OPERATOR_RUNNING_MODAL;
/* execute the events */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
ret = OPERATOR_FINISHED;
break;
@@ -233,8 +233,8 @@ static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
break;
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
+ case EVT_LEFTCTRLKEY:
+ case EVT_RIGHTCTRLKEY:
if (event->val == KM_RELEASE) {
RNA_boolean_set(op->ptr, "snap", false);
}
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index 63c096abc6d..4bd7ad6629a 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -1329,7 +1329,7 @@ static void poselib_preview_handle_search(tPoseLib_PreviewData *pld,
{
/* try doing some form of string manipulation first */
switch (event) {
- case BACKSPACEKEY:
+ case EVT_BACKSPACEKEY:
if (pld->searchstr[0] && pld->search_cursor) {
short len = strlen(pld->searchstr);
short index = pld->search_cursor;
@@ -1347,7 +1347,7 @@ static void poselib_preview_handle_search(tPoseLib_PreviewData *pld,
}
break;
- case DELKEY:
+ case EVT_DELKEY:
if (pld->searchstr[0] && pld->searchstr[1]) {
short len = strlen(pld->searchstr);
short index = pld->search_cursor;
@@ -1414,16 +1414,16 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
if (pld->flag & PL_PREVIEW_SHOWORIGINAL) {
switch (event->type) {
/* exit - cancel */
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
pld->state = PL_PREVIEW_CANCEL;
break;
/* exit - confirm */
case LEFTMOUSE:
- case RETKEY:
- case PADENTER:
- case SPACEKEY:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
+ case EVT_SPACEKEY:
pld->state = PL_PREVIEW_CONFIRM;
break;
@@ -1431,18 +1431,18 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
/* we add pass through here, so that the operators responsible for these can still run,
* even though we still maintain control (as RUNNING_MODAL flag is still set too)
*/
- case PAD0:
- case PAD1:
- case PAD2:
- case PAD3:
- case PAD4:
- case PAD5:
- case PAD6:
- case PAD7:
- case PAD8:
- case PAD9:
- case PADPLUSKEY:
- case PADMINUS:
+ case EVT_PAD0:
+ case EVT_PAD1:
+ case EVT_PAD2:
+ case EVT_PAD3:
+ case EVT_PAD4:
+ case EVT_PAD5:
+ case EVT_PAD6:
+ case EVT_PAD7:
+ case EVT_PAD8:
+ case EVT_PAD9:
+ case EVT_PADPLUSKEY:
+ case EVT_PADMINUS:
case MIDDLEMOUSE:
case MOUSEMOVE:
// pld->redraw = PL_PREVIEW_REDRAWHEADER;
@@ -1450,7 +1450,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
break;
/* quicky compare to original */
- case TABKEY:
+ case EVT_TABKEY:
pld->flag &= ~PL_PREVIEW_SHOWORIGINAL;
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
@@ -1464,53 +1464,53 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
/* searching takes priority over normal activity */
switch (event->type) {
/* exit - cancel */
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
pld->state = PL_PREVIEW_CANCEL;
break;
/* exit - confirm */
case LEFTMOUSE:
- case RETKEY:
- case PADENTER:
- case SPACEKEY:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
+ case EVT_SPACEKEY:
pld->state = PL_PREVIEW_CONFIRM;
break;
/* toggle between original pose and poselib pose*/
- case TABKEY:
+ case EVT_TABKEY:
pld->flag |= PL_PREVIEW_SHOWORIGINAL;
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
/* change to previous pose (cyclic) */
- case PAGEUPKEY:
+ case EVT_PAGEUPKEY:
case WHEELUPMOUSE:
poselib_preview_get_next(pld, -1);
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
/* change to next pose (cyclic) */
- case PAGEDOWNKEY:
+ case EVT_PAGEDOWNKEY:
case WHEELDOWNMOUSE:
poselib_preview_get_next(pld, 1);
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
/* jump 5 poses (cyclic, back) */
- case DOWNARROWKEY:
+ case EVT_DOWNARROWKEY:
poselib_preview_get_next(pld, -5);
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
/* jump 5 poses (cyclic, forward) */
- case UPARROWKEY:
+ case EVT_UPARROWKEY:
poselib_preview_get_next(pld, 5);
pld->redraw = PL_PREVIEW_REDRAWALL;
break;
/* change to next pose or searching cursor control */
- case RIGHTARROWKEY:
+ case EVT_RIGHTARROWKEY:
if (pld->searchstr[0]) {
/* move text-cursor to the right */
if (pld->search_cursor < strlen(pld->searchstr)) {
@@ -1526,7 +1526,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
break;
/* change to next pose or searching cursor control */
- case LEFTARROWKEY:
+ case EVT_LEFTARROWKEY:
if (pld->searchstr[0]) {
/* move text-cursor to the left */
if (pld->search_cursor) {
@@ -1542,7 +1542,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
break;
/* change to first pose or start of searching string */
- case HOMEKEY:
+ case EVT_HOMEKEY:
if (pld->searchstr[0]) {
pld->search_cursor = 0;
pld->redraw = PL_PREVIEW_REDRAWHEADER;
@@ -1557,7 +1557,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
break;
/* change to last pose or start of searching string */
- case ENDKEY:
+ case EVT_ENDKEY:
if (pld->searchstr[0]) {
pld->search_cursor = strlen(pld->searchstr);
pld->redraw = PL_PREVIEW_REDRAWHEADER;
@@ -1582,18 +1582,18 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con
break;
/* view manipulation, or searching */
- case PAD0:
- case PAD1:
- case PAD2:
- case PAD3:
- case PAD4:
- case PAD5:
- case PAD6:
- case PAD7:
- case PAD8:
- case PAD9:
- case PADPLUSKEY:
- case PADMINUS:
+ case EVT_PAD0:
+ case EVT_PAD1:
+ case EVT_PAD2:
+ case EVT_PAD3:
+ case EVT_PAD4:
+ case EVT_PAD5:
+ case EVT_PAD6:
+ case EVT_PAD7:
+ case EVT_PAD8:
+ case EVT_PAD9:
+ case EVT_PADPLUSKEY:
+ case EVT_PADMINUS:
if (pld->searchstr[0]) {
/* searching... */
poselib_preview_handle_search(pld, event->type, event->ascii);
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 8463f0ef827..f24779e1baa 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -1067,8 +1067,8 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
switch (event->type) {
case LEFTMOUSE: /* confirm */
- case RETKEY:
- case PADENTER: {
+ case EVT_RETKEY:
+ case EVT_PADENTER: {
if (event->val == KM_PRESS) {
/* return to normal cursor and header status */
ED_area_status_text(pso->sa, NULL);
@@ -1084,7 +1084,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
}
- case ESCKEY: /* cancel */
+ case EVT_ESCKEY: /* cancel */
case RIGHTMOUSE: {
if (event->val == KM_PRESS) {
/* return to normal cursor and header status */
@@ -1141,31 +1141,31 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
switch (event->type) {
/* Transform Channel Limits */
/* XXX: Replace these hardcoded hotkeys with a modalmap that can be customised */
- case GKEY: /* Location */
+ case EVT_GKEY: /* Location */
{
pose_slide_toggle_channels_mode(op, pso, PS_TFM_LOC);
do_pose_update = true;
break;
}
- case RKEY: /* Rotation */
+ case EVT_RKEY: /* Rotation */
{
pose_slide_toggle_channels_mode(op, pso, PS_TFM_ROT);
do_pose_update = true;
break;
}
- case SKEY: /* Scale */
+ case EVT_SKEY: /* Scale */
{
pose_slide_toggle_channels_mode(op, pso, PS_TFM_SIZE);
do_pose_update = true;
break;
}
- case BKEY: /* Bendy Bones */
+ case EVT_BKEY: /* Bendy Bones */
{
pose_slide_toggle_channels_mode(op, pso, PS_TFM_BBONE_SHAPE);
do_pose_update = true;
break;
}
- case CKEY: /* Custom Properties */
+ case EVT_CKEY: /* Custom Properties */
{
pose_slide_toggle_channels_mode(op, pso, PS_TFM_PROPS);
do_pose_update = true;
@@ -1174,19 +1174,19 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Axis Locks */
/* XXX: Hardcoded... */
- case XKEY: {
+ case EVT_XKEY: {
if (pose_slide_toggle_axis_locks(op, pso, PS_LOCK_X)) {
do_pose_update = true;
}
break;
}
- case YKEY: {
+ case EVT_YKEY: {
if (pose_slide_toggle_axis_locks(op, pso, PS_LOCK_Y)) {
do_pose_update = true;
}
break;
}
- case ZKEY: {
+ case EVT_ZKEY: {
if (pose_slide_toggle_axis_locks(op, pso, PS_LOCK_Z)) {
do_pose_update = true;
}
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 85441c9b88d..ffc09596b03 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -1154,7 +1154,7 @@ static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_FINISHED;
}
}
- else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
+ else if (ELEM(event->type, EVT_ESCKEY, RIGHTMOUSE)) {
ED_region_tag_redraw(cdd->vc.region);
curve_draw_cancel(C, op);
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 1f57c6cfe0a..5fe7082d59b 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -1684,7 +1684,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event)
}
/* tab should exit editmode, but we allow it to be typed using modifier keys */
- if (event_type == TABKEY) {
+ if (event_type == EVT_TABKEY) {
if ((alt || ctrl || shift) == 0) {
return OPERATOR_PASS_THROUGH;
}
@@ -1693,7 +1693,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event)
}
}
- if (event_type == BACKSPACEKEY) {
+ if (event_type == EVT_BACKSPACEKEY) {
if (alt && ef->len != 0 && ef->pos > 0) {
accentcode = 1;
}
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 3e33f811225..5629e29f257 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2050,20 +2050,35 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* We don't pass on key events, GP is used with key-modifiers -
* prevents Dkey to insert drivers. */
if (ISKEYBOARD(event->type)) {
- if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY, ZKEY)) {
+ if (ELEM(event->type,
+ EVT_LEFTARROWKEY,
+ EVT_DOWNARROWKEY,
+ EVT_RIGHTARROWKEY,
+ EVT_UPARROWKEY,
+ EVT_ZKEY)) {
/* allow some keys:
* - for frame changing [#33412]
* - for undo (during sketching sessions)
*/
}
- else if (ELEM(event->type, PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9)) {
+ else if (ELEM(event->type,
+ EVT_PAD0,
+ EVT_PAD1,
+ EVT_PAD2,
+ EVT_PAD3,
+ EVT_PAD4,
+ EVT_PAD5,
+ EVT_PAD6,
+ EVT_PAD7,
+ EVT_PAD8,
+ EVT_PAD9)) {
/* allow numpad keys so that camera/view manipulations can still take place
* - PAD0 in particular is really important for Grease Pencil drawing,
* as animators may be working "to camera", so having this working
* is essential for ensuring that they can quickly return to that view
*/
}
- else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_BKEY) && (event->val == KM_RELEASE)) {
/* Add Blank Frame
* - Since this operator is non-modal, we can just call it here, and keep going...
* - This operator is especially useful when animating
@@ -2083,7 +2098,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
* NOTE: cannot do RIGHTMOUSE (as is standard for canceling)
* as that would break polyline T32647.
*/
- if (event->val == KM_PRESS && ELEM(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY, EKEY)) {
+ if (event->val == KM_PRESS &&
+ ELEM(event->type, EVT_RETKEY, EVT_PADENTER, EVT_ESCKEY, EVT_SPACEKEY, EVT_EKEY)) {
/* exit() ends the current stroke before cleaning up */
/* printf("\t\tGP - end of paint op + end of stroke\n"); */
p->status = GP_STATUS_DONE;
@@ -2261,19 +2277,19 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* eraser size */
else if ((p->paintmode == GP_PAINTMODE_ERASER) &&
- ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, PADPLUSKEY, PADMINUS)) {
+ ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) {
/* just resize the brush (local version)
* TODO: fix the hardcoded size jumps (set to make a visible difference) and hardcoded keys
*/
/* printf("\t\tGP - resize eraser\n"); */
switch (event->type) {
case WHEELDOWNMOUSE: /* larger */
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
p->radius += 5;
break;
case WHEELUPMOUSE: /* smaller */
- case PADMINUS:
+ case EVT_PADMINUS:
p->radius -= 5;
if (p->radius <= 0) {
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index c928c1e933a..a7fc5a4965b 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1487,7 +1487,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
int estate = OPERATOR_PASS_THROUGH; /* default exit state - pass through */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
estate = OPERATOR_CANCELLED;
break;
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index bd00a492035..958728c2baf 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -563,8 +563,8 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent
switch (event->type) {
case LEFTMOUSE: /* confirm */
- case PADENTER:
- case RETKEY: {
+ case EVT_PADENTER:
+ case EVT_RETKEY: {
/* return to normal cursor and header status */
ED_area_status_text(tgpi->sa, NULL);
ED_workspace_status_text(C, NULL);
@@ -598,7 +598,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent
return OPERATOR_FINISHED;
}
- case ESCKEY: /* cancel */
+ case EVT_ESCKEY: /* cancel */
case RIGHTMOUSE: {
/* return to normal cursor and header status */
ED_area_status_text(tgpi->sa, NULL);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index e7586d95d29..90076b8d91b 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2897,7 +2897,7 @@ static void gpencil_guide_event_handling(bContext *C,
GP_Sculpt_Guide *guide = &p->scene->toolsettings->gp_sculpt.guide;
/* Enter or exit set center point mode */
- if ((event->type == OKEY) && (event->val == KM_RELEASE)) {
+ if ((event->type == EVT_OKEY) && (event->val == KM_RELEASE)) {
if ((p->paintmode == GP_PAINTMODE_DRAW) && guide->use_guide &&
(guide->reference_point != GP_GUIDE_REF_OBJECT)) {
add_notifier = true;
@@ -2906,12 +2906,12 @@ static void gpencil_guide_event_handling(bContext *C,
}
}
/* Freehand mode, turn off speed guide */
- else if ((event->type == VKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_VKEY) && (event->val == KM_RELEASE)) {
guide->use_guide = false;
add_notifier = true;
}
/* Alternate or flip direction */
- else if ((event->type == MKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_MKEY) && (event->val == KM_RELEASE)) {
if (guide->type == GP_GUIDE_CIRCULAR) {
add_notifier = true;
guide->type = GP_GUIDE_RADIAL;
@@ -2930,7 +2930,7 @@ static void gpencil_guide_event_handling(bContext *C,
}
}
/* Line guides */
- else if ((event->type == LKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_LKEY) && (event->val == KM_RELEASE)) {
add_notifier = true;
guide->use_guide = true;
if (event->ctrl) {
@@ -2946,7 +2946,7 @@ static void gpencil_guide_event_handling(bContext *C,
}
}
/* Point guide */
- else if ((event->type == CKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_CKEY) && (event->val == KM_RELEASE)) {
add_notifier = true;
if (!guide->use_guide) {
guide->use_guide = true;
@@ -2963,7 +2963,7 @@ static void gpencil_guide_event_handling(bContext *C,
}
}
/* Change line angle */
- else if (ELEM(event->type, JKEY, KKEY) && (event->val == KM_RELEASE)) {
+ else if (ELEM(event->type, EVT_JKEY, EVT_KKEY) && (event->val == KM_RELEASE)) {
add_notifier = true;
float angle = guide->angle;
float adjust = (float)M_PI / 180.0f;
@@ -2973,7 +2973,7 @@ static void gpencil_guide_event_handling(bContext *C,
else if (!event->shift) {
adjust *= 15.0f;
}
- angle += (event->type == JKEY) ? adjust : -adjust;
+ angle += (event->type == EVT_JKEY) ? adjust : -adjust;
angle = angle_compat_rad(angle, M_PI);
guide->angle = angle;
}
@@ -3373,7 +3373,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
switch (event->type) {
/* cancel */
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE: {
if (ELEM(event->val, KM_RELEASE)) {
drawmode = true;
@@ -3404,26 +3404,36 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* We don't pass on key events, GP is used with key-modifiers -
* prevents Dkey to insert drivers. */
if (ISKEYBOARD(event->type)) {
- if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY)) {
+ if (ELEM(event->type, EVT_LEFTARROWKEY, EVT_DOWNARROWKEY, EVT_RIGHTARROWKEY, EVT_UPARROWKEY)) {
/* allow some keys:
* - for frame changing [#33412]
* - for undo (during sketching sessions)
*/
}
- else if (event->type == ZKEY) {
+ else if (event->type == EVT_ZKEY) {
if (event->ctrl) {
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
}
}
- else if (ELEM(event->type, PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9)) {
+ else if (ELEM(event->type,
+ EVT_PAD0,
+ EVT_PAD1,
+ EVT_PAD2,
+ EVT_PAD3,
+ EVT_PAD4,
+ EVT_PAD5,
+ EVT_PAD6,
+ EVT_PAD7,
+ EVT_PAD8,
+ EVT_PAD9)) {
/* allow numpad keys so that camera/view manipulations can still take place
* - PAD0 in particular is really important for Grease Pencil drawing,
* as animators may be working "to camera", so having this working
* is essential for ensuring that they can quickly return to that view
*/
}
- else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_BKEY) && (event->val == KM_RELEASE)) {
/* Add Blank Frame
* - Since this operator is non-modal, we can just call it here, and keep going...
* - This operator is especially useful when animating
@@ -3443,7 +3453,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Exit painting mode (and/or end current stroke).
*
*/
- if (ELEM(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY, EKEY)) {
+ if (ELEM(event->type, EVT_RETKEY, EVT_PADENTER, EVT_ESCKEY, EVT_SPACEKEY, EVT_EKEY)) {
p->status = GP_STATUS_DONE;
estate = OPERATOR_FINISHED;
@@ -3591,16 +3601,16 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* eraser size */
else if ((p->paintmode == GP_PAINTMODE_ERASER) &&
- ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, PADPLUSKEY, PADMINUS)) {
+ ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) {
/* Just resize the brush (local version). */
switch (event->type) {
case WHEELDOWNMOUSE: /* larger */
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
p->radius += 5;
break;
case WHEELUPMOUSE: /* smaller */
- case PADMINUS:
+ case EVT_PADMINUS:
p->radius -= 5;
if (p->radius <= 0) {
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 5cb34b1c08b..f7bfc0bab8c 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1429,7 +1429,7 @@ static void gpencil_primitive_edit_event_handling(
}
break;
}
- case MKEY: {
+ case EVT_MKEY: {
if ((event->val == KM_PRESS) && (tgpi->curve) && (ELEM(tgpi->orign_type, GP_STROKE_ARC))) {
tgpi->flip ^= 1;
gp_primitive_update_cps(tgpi);
@@ -1437,7 +1437,7 @@ static void gpencil_primitive_edit_event_handling(
}
break;
}
- case EKEY: {
+ case EVT_EKEY: {
if (tgpi->flag == IN_CURVE_EDIT && !ELEM(tgpi->type, GP_STROKE_BOX, GP_STROKE_CIRCLE)) {
tgpi->flag = IN_PROGRESS;
WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL);
@@ -1544,7 +1544,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
gpencil_primitive_update(C, op, tgpi);
break;
}
- case ESCKEY:
+ case EVT_ESCKEY:
case LEFTMOUSE: {
zero_v2(tgpi->move);
tgpi->flag = IN_CURVE_EDIT;
@@ -1566,7 +1566,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
switch (event->type) {
- case ESCKEY: {
+ case EVT_ESCKEY: {
/* return to normal cursor and header status */
ED_workspace_status_text(C, NULL);
WM_cursor_modal_restore(win);
@@ -1588,9 +1588,9 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case SPACEKEY: /* confirm */
+ case EVT_SPACEKEY: /* confirm */
case MIDDLEMOUSE:
- case RETKEY:
+ case EVT_RETKEY:
case RIGHTMOUSE: {
if (event->val == KM_PRESS) {
tgpi->flag = IDLE;
@@ -1612,7 +1612,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
gpencil_primitive_update(C, op, tgpi);
break;
}
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
case WHEELUPMOUSE: {
if ((event->val != KM_RELEASE)) {
tgpi->tot_edges = tgpi->tot_edges + 1;
@@ -1622,7 +1622,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case PADMINUS:
+ case EVT_PADMINUS:
case WHEELDOWNMOUSE: {
if ((event->val != KM_RELEASE)) {
tgpi->tot_edges = tgpi->tot_edges - 1;
@@ -1632,7 +1632,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case FKEY: /* brush thickness/ brush strength */
+ case EVT_FKEY: /* brush thickness/ brush strength */
{
if ((event->val == KM_PRESS)) {
if (event->shift) {
@@ -1658,7 +1658,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
gpencil_primitive_size(tgpi, false);
gpencil_primitive_update(C, op, tgpi);
break;
- case ESCKEY:
+ case EVT_ESCKEY:
case MIDDLEMOUSE:
case LEFTMOUSE:
tgpi->brush_size = 0;
@@ -1681,7 +1681,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
gpencil_primitive_strength(tgpi, false);
gpencil_primitive_update(C, op, tgpi);
break;
- case ESCKEY:
+ case EVT_ESCKEY:
case MIDDLEMOUSE:
case LEFTMOUSE:
tgpi->brush_strength = 0.0f;
@@ -1748,10 +1748,10 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case SPACEKEY: /* confirm */
+ case EVT_SPACEKEY: /* confirm */
case MIDDLEMOUSE:
- case PADENTER:
- case RETKEY: {
+ case EVT_PADENTER:
+ case EVT_RETKEY: {
tgpi->flag = IDLE;
gpencil_primitive_interaction_end(C, op, win, tgpi);
/* done! */
@@ -1769,7 +1769,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
ATTR_FALLTHROUGH;
}
- case ESCKEY: {
+ case EVT_ESCKEY: {
/* return to normal cursor and header status */
ED_workspace_status_text(C, NULL);
WM_cursor_modal_restore(win);
@@ -1780,7 +1780,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
/* canceled! */
return OPERATOR_CANCELLED;
}
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
case WHEELUPMOUSE: {
if ((event->val != KM_RELEASE)) {
tgpi->tot_edges = tgpi->tot_edges + 1;
@@ -1792,7 +1792,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case PADMINUS:
+ case EVT_PADMINUS:
case WHEELDOWNMOUSE: {
if ((event->val != KM_RELEASE)) {
tgpi->tot_edges = tgpi->tot_edges - 1;
@@ -1804,7 +1804,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case GKEY: /* grab mode */
+ case EVT_GKEY: /* grab mode */
{
if ((event->val == KM_PRESS)) {
tgpi->flag = IN_MOVE;
@@ -1812,7 +1812,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case FKEY: /* brush thickness/ brush strength */
+ case EVT_FKEY: /* brush thickness/ brush strength */
{
if ((event->val == KM_PRESS)) {
if (event->shift) {
@@ -1827,7 +1827,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case CKEY: /* curve mode */
+ case EVT_CKEY: /* curve mode */
{
if ((event->val == KM_PRESS) && (tgpi->orign_type == GP_STROKE_CURVE)) {
switch (tgpi->type) {
@@ -1846,7 +1846,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
}
break;
}
- case TABKEY: {
+ case EVT_TABKEY: {
if (tgpi->flag == IN_CURVE_EDIT) {
tgpi->flag = IN_PROGRESS;
WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL);
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 5db331280f8..8c92d53b8e6 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -2028,7 +2028,7 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even
/* Abort painting if any of the usual things are tried */
case MIDDLEMOUSE:
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gpsculpt_brush_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -2050,7 +2050,7 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even
/* Exit modal operator, based on the "standard" ops */
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gpsculpt_brush_exit(C, op);
return OPERATOR_FINISHED;
@@ -2065,24 +2065,24 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even
break;
/* Change Frame - Allowed */
- case LEFTARROWKEY:
- case RIGHTARROWKEY:
- case UPARROWKEY:
- case DOWNARROWKEY:
+ case EVT_LEFTARROWKEY:
+ case EVT_RIGHTARROWKEY:
+ case EVT_UPARROWKEY:
+ case EVT_DOWNARROWKEY:
return OPERATOR_PASS_THROUGH;
/* Camera/View Gizmo's - Allowed */
/* (See rationale in gpencil_paint.c -> gpencil_draw_modal()) */
- case PAD0:
- case PAD1:
- case PAD2:
- case PAD3:
- case PAD4:
- case PAD5:
- case PAD6:
- case PAD7:
- case PAD8:
- case PAD9:
+ case EVT_PAD0:
+ case EVT_PAD1:
+ case EVT_PAD2:
+ case EVT_PAD3:
+ case EVT_PAD4:
+ case EVT_PAD5:
+ case EVT_PAD6:
+ case EVT_PAD7:
+ case EVT_PAD8:
+ case EVT_PAD9:
return OPERATOR_PASS_THROUGH;
/* Unhandled event */
diff --git a/source/blender/editors/gpencil/gpencil_uv.c b/source/blender/editors/gpencil/gpencil_uv.c
index 5e397374437..8e9d46793a9 100644
--- a/source/blender/editors/gpencil/gpencil_uv.c
+++ b/source/blender/editors/gpencil/gpencil_uv.c
@@ -436,7 +436,7 @@ static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEve
GpUvData *opdata = op->customdata;
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE: {
gpencil_transform_fill_cancel(C, op);
return OPERATOR_CANCELLED;
@@ -455,8 +455,8 @@ static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEve
break;
}
case LEFTMOUSE:
- case PADENTER:
- case RETKEY: {
+ case EVT_PADENTER:
+ case EVT_RETKEY: {
if ((event->val == KM_PRESS) ||
((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) {
gpencil_uv_transform_calc(C, op);
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 45dc22bafba..0c3b29ab1ea 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -1308,7 +1308,7 @@ static int gp_vertexpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
/* Abort painting if any of the usual things are tried */
case MIDDLEMOUSE:
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gp_vertexpaint_brush_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -1329,7 +1329,7 @@ static int gp_vertexpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
/* Exit modal operator, based on the "standard" ops */
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gp_vertexpaint_brush_exit(C, op);
return OPERATOR_FINISHED;
@@ -1344,24 +1344,24 @@ static int gp_vertexpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
break;
/* Change Frame - Allowed */
- case LEFTARROWKEY:
- case RIGHTARROWKEY:
- case UPARROWKEY:
- case DOWNARROWKEY:
+ case EVT_LEFTARROWKEY:
+ case EVT_RIGHTARROWKEY:
+ case EVT_UPARROWKEY:
+ case EVT_DOWNARROWKEY:
return OPERATOR_PASS_THROUGH;
/* Camera/View Gizmo's - Allowed */
/* (See rationale in gpencil_paint.c -> gpencil_draw_modal()) */
- case PAD0:
- case PAD1:
- case PAD2:
- case PAD3:
- case PAD4:
- case PAD5:
- case PAD6:
- case PAD7:
- case PAD8:
- case PAD9:
+ case EVT_PAD0:
+ case EVT_PAD1:
+ case EVT_PAD2:
+ case EVT_PAD3:
+ case EVT_PAD4:
+ case EVT_PAD5:
+ case EVT_PAD6:
+ case EVT_PAD7:
+ case EVT_PAD8:
+ case EVT_PAD9:
return OPERATOR_PASS_THROUGH;
/* Unhandled event */
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index c519129cdf7..0dace9f004b 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -798,7 +798,7 @@ static int gp_weightpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
/* Abort painting if any of the usual things are tried */
case MIDDLEMOUSE:
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gp_weightpaint_brush_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -819,7 +819,7 @@ static int gp_weightpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
/* Exit modal operator, based on the "standard" ops */
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
gp_weightpaint_brush_exit(C, op);
return OPERATOR_FINISHED;
@@ -834,24 +834,24 @@ static int gp_weightpaint_brush_modal(bContext *C, wmOperator *op, const wmEvent
break;
/* Change Frame - Allowed */
- case LEFTARROWKEY:
- case RIGHTARROWKEY:
- case UPARROWKEY:
- case DOWNARROWKEY:
+ case EVT_LEFTARROWKEY:
+ case EVT_RIGHTARROWKEY:
+ case EVT_UPARROWKEY:
+ case EVT_DOWNARROWKEY:
return OPERATOR_PASS_THROUGH;
/* Camera/View Gizmo's - Allowed */
/* (See rationale in gpencil_paint.c -> gpencil_draw_modal()) */
- case PAD0:
- case PAD1:
- case PAD2:
- case PAD3:
- case PAD4:
- case PAD5:
- case PAD6:
- case PAD7:
- case PAD8:
- case PAD9:
+ case EVT_PAD0:
+ case EVT_PAD1:
+ case EVT_PAD2:
+ case EVT_PAD3:
+ case EVT_PAD4:
+ case EVT_PAD5:
+ case EVT_PAD6:
+ case EVT_PAD7:
+ case EVT_PAD8:
+ case EVT_PAD9:
return OPERATOR_PASS_THROUGH;
/* Unhandled event */
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index f6da9663daf..7a300860583 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -233,7 +233,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
/* XXX this guess_opname can potentially return a different keymap
* than being found on adding later... */
km = WM_keymap_guess_opname(C, idname);
- kmi = WM_keymap_add_item(km, idname, AKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(km, idname, EVT_AKEY, KM_PRESS, 0, 0);
kmi_id = kmi->id;
/* This takes ownership of prop, or prop can be NULL for reset. */
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index f4dd114c312..27549ed60b5 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -634,8 +634,8 @@ static enum eSnapType ui_event_to_snap(const wmEvent *event)
static bool ui_event_is_snap(const wmEvent *event)
{
- return (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY) ||
- ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY));
+ return (ELEM(event->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY) ||
+ ELEM(event->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY));
}
static void ui_color_snap_hue(const enum eSnapType snap, float *r_hue)
@@ -3513,7 +3513,7 @@ static void ui_do_but_textedit(
break;
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
if (event->val == KM_PRESS) {
#ifdef WITH_INPUT_IME
/* skips button handling since it is not wanted */
@@ -3584,24 +3584,24 @@ static void ui_do_but_textedit(
if (event->val == KM_PRESS && !is_ime_composing) {
switch (event->type) {
- case VKEY:
- case XKEY:
- case CKEY:
+ case EVT_VKEY:
+ case EVT_XKEY:
+ case EVT_CKEY:
if (IS_EVENT_MOD(event, ctrl, oskey)) {
- if (event->type == VKEY) {
+ if (event->type == EVT_VKEY) {
changed = ui_textedit_copypaste(but, data, UI_TEXTEDIT_PASTE);
}
- else if (event->type == CKEY) {
+ else if (event->type == EVT_CKEY) {
changed = ui_textedit_copypaste(but, data, UI_TEXTEDIT_COPY);
}
- else if (event->type == XKEY) {
+ else if (event->type == EVT_XKEY) {
changed = ui_textedit_copypaste(but, data, UI_TEXTEDIT_CUT);
}
retval = WM_UI_HANDLER_BREAK;
}
break;
- case RIGHTARROWKEY:
+ case EVT_RIGHTARROWKEY:
ui_textedit_move(but,
data,
STRCUR_DIR_NEXT,
@@ -3609,7 +3609,7 @@ static void ui_do_but_textedit(
event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval = WM_UI_HANDLER_BREAK;
break;
- case LEFTARROWKEY:
+ case EVT_LEFTARROWKEY:
ui_textedit_move(but,
data,
STRCUR_DIR_PREV,
@@ -3618,7 +3618,7 @@ static void ui_do_but_textedit(
retval = WM_UI_HANDLER_BREAK;
break;
case WHEELDOWNMOUSE:
- case DOWNARROWKEY:
+ case EVT_DOWNARROWKEY:
if (data->searchbox) {
#ifdef USE_KEYNAV_LIMIT
ui_mouse_motion_keynav_init(&data->searchbox_keynav_state, event);
@@ -3630,12 +3630,12 @@ static void ui_do_but_textedit(
break;
}
ATTR_FALLTHROUGH;
- case ENDKEY:
+ case EVT_ENDKEY:
ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift != 0, STRCUR_JUMP_ALL);
retval = WM_UI_HANDLER_BREAK;
break;
case WHEELUPMOUSE:
- case UPARROWKEY:
+ case EVT_UPARROWKEY:
if (data->searchbox) {
#ifdef USE_KEYNAV_LIMIT
ui_mouse_motion_keynav_init(&data->searchbox_keynav_state, event);
@@ -3647,28 +3647,28 @@ static void ui_do_but_textedit(
break;
}
ATTR_FALLTHROUGH;
- case HOMEKEY:
+ case EVT_HOMEKEY:
ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift != 0, STRCUR_JUMP_ALL);
retval = WM_UI_HANDLER_BREAK;
break;
- case PADENTER:
- case RETKEY:
+ case EVT_PADENTER:
+ case EVT_RETKEY:
button_activate_state(C, but, BUTTON_STATE_EXIT);
retval = WM_UI_HANDLER_BREAK;
break;
- case DELKEY:
+ case EVT_DELKEY:
changed = ui_textedit_delete(
but, data, 1, event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval = WM_UI_HANDLER_BREAK;
break;
- case BACKSPACEKEY:
+ case EVT_BACKSPACEKEY:
changed = ui_textedit_delete(
but, data, 0, event->ctrl ? STRCUR_JUMP_DELIM : STRCUR_JUMP_NONE);
retval = WM_UI_HANDLER_BREAK;
break;
- case AKEY:
+ case EVT_AKEY:
/* Ctrl + A: Select all */
#if defined(__APPLE__)
@@ -3685,7 +3685,7 @@ static void ui_do_but_textedit(
}
break;
- case TABKEY:
+ case EVT_TABKEY:
/* there is a key conflict here, we can't tab with autocomplete */
if (but->autocomplete_func || data->searchbox) {
int autocomplete = ui_textedit_autocomplete(C, but, data);
@@ -3719,7 +3719,7 @@ static void ui_do_but_textedit(
/* exception that's useful for number buttons, some keyboard
* numpads have a comma instead of a period */
if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER)) { /* could use data->min*/
- if (event->type == PADPERIOD && ascii == ',') {
+ if (event->type == EVT_PADPERIOD && ascii == ',') {
ascii = '.';
utf8_buf = NULL; /* force ascii fallback */
}
@@ -4194,7 +4194,7 @@ static int ui_do_but_BUT(bContext *C, uiBut *but, uiHandleButtonData *data, cons
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
- else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ else if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_FLASH);
return WM_UI_HANDLER_BREAK;
}
@@ -4218,7 +4218,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C,
const wmEvent *event)
{
if (data->state == BUTTON_STATE_HIGHLIGHT) {
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
but->drawstr[0] = 0;
but->modifier_key = 0;
button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
@@ -4229,11 +4229,11 @@ static int ui_do_but_HOTKEYEVT(bContext *C,
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
return WM_UI_HANDLER_CONTINUE;
}
- else if (event->type == UNKNOWNKEY) {
+ else if (event->type == EVT_UNKNOWNKEY) {
WM_report(RPT_WARNING, "Unsupported key: Unknown");
return WM_UI_HANDLER_CONTINUE;
}
- else if (event->type == CAPSLOCKKEY) {
+ else if (event->type == EVT_CAPSLOCKKEY) {
WM_report(RPT_WARNING, "Unsupported key: CapsLock");
return WM_UI_HANDLER_CONTINUE;
}
@@ -4272,7 +4272,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C,
ED_region_tag_redraw(data->region);
if (event->val == KM_PRESS) {
- if (ISHOTKEY(event->type) && (event->type != ESCKEY)) {
+ if (ISHOTKEY(event->type) && (event->type != EVT_ESCKEY)) {
if (WM_key_event_string(event->type, false)[0]) {
ui_but_value_set(but, event->type);
}
@@ -4283,7 +4283,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C,
button_activate_state(C, but, BUTTON_STATE_EXIT);
return WM_UI_HANDLER_BREAK;
}
- else if (event->type == ESCKEY) {
+ else if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -4302,7 +4302,7 @@ static int ui_do_but_KEYEVT(bContext *C,
const wmEvent *event)
{
if (data->state == BUTTON_STATE_HIGHLIGHT) {
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT);
return WM_UI_HANDLER_BREAK;
}
@@ -4349,7 +4349,7 @@ static int ui_do_but_TAB(
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
return WM_UI_HANDLER_BREAK;
}
- else if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY)) {
+ else if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY)) {
int event_val = (is_property) ? KM_PRESS : KM_CLICK;
if (event->val == event_val) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -4373,8 +4373,9 @@ static int ui_do_but_TEX(
bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
{
if (data->state == BUTTON_STATE_HIGHLIGHT) {
- if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) && event->val == KM_PRESS) {
- if (ELEM(event->type, PADENTER, RETKEY) && (!UI_but_is_utf8(but))) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, EVT_PADENTER, EVT_RETKEY) &&
+ event->val == KM_PRESS) {
+ if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY) && (!UI_but_is_utf8(but))) {
/* pass - allow filesel, enter to execute */
}
else if (but->dt == UI_EMBOSS_NONE && !event->ctrl) {
@@ -4404,7 +4405,7 @@ static int ui_do_but_SEARCH_UNLINK(
bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event)
{
/* unlink icon is on right */
- if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY)) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, EVT_PADENTER, EVT_RETKEY)) {
/* doing this on KM_PRESS calls eyedropper after clicking unlink icon */
if ((event->val == KM_RELEASE) && ui_do_but_extra_operator_icon(C, but, data, event)) {
return WM_UI_HANDLER_BREAK;
@@ -4426,7 +4427,7 @@ static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, cons
if (data->state == BUTTON_STATE_HIGHLIGHT) {
bool do_activate = false;
- if (ELEM(event->type, PADENTER, RETKEY)) {
+ if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY)) {
if (event->val == KM_PRESS) {
do_activate = true;
}
@@ -4511,7 +4512,7 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con
}
#endif
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
int ret = WM_UI_HANDLER_BREAK;
/* XXX (a bit ugly) Special case handling for filebrowser drag button */
if (but->dragpoin && but->imb && ui_but_contains_point_px_icon(but, data->region, event)) {
@@ -4910,7 +4911,7 @@ static int ui_do_but_NUM(
click = 1;
}
else if (event->val == KM_PRESS) {
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->ctrl) {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
retval = WM_UI_HANDLER_BREAK;
}
@@ -4919,10 +4920,10 @@ static int ui_do_but_NUM(
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
retval = WM_UI_HANDLER_BREAK;
}
- else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ else if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
click = 1;
}
- else if (event->type == MINUSKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_MINUSKEY && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
data->value = -data->value;
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -4935,7 +4936,7 @@ static int ui_do_but_NUM(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
+ if (event->type == EVT_ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -5214,7 +5215,7 @@ static int ui_do_but_SLI(
click = 2;
}
else if (event->val == KM_PRESS) {
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->ctrl) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->ctrl) {
button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
retval = WM_UI_HANDLER_BREAK;
}
@@ -5238,10 +5239,10 @@ static int ui_do_but_SLI(
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
retval = WM_UI_HANDLER_BREAK;
}
- else if (ELEM(event->type, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ else if (ELEM(event->type, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
click = 1;
}
- else if (event->type == MINUSKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_MINUSKEY && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
data->value = -data->value;
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -5253,7 +5254,7 @@ static int ui_do_but_SLI(
#endif
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
+ if (event->type == EVT_ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -5420,7 +5421,7 @@ static int ui_do_but_SCROLL(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY) {
+ if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -5472,7 +5473,7 @@ static int ui_do_but_GRIP(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY) {
+ if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -5505,7 +5506,7 @@ static int ui_do_but_LISTROW(bContext *C,
/* hack to pass on ctrl+click and double click to overlapping text
* editing field for editing list item names
*/
- if ((ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS &&
+ if ((ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS &&
event->ctrl) ||
(event->type == LEFTMOUSE && event->val == KM_DBL_CLICK)) {
uiBut *labelbut = ui_but_list_row_text_activate(
@@ -5543,7 +5544,7 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, co
}
#endif
/* regular open menu */
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
return WM_UI_HANDLER_BREAK;
}
@@ -5716,7 +5717,7 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co
}
#endif
/* regular open menu */
- if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && event->val == KM_PRESS) {
ui_palette_set_active(but);
button_activate_state(C, but, BUTTON_STATE_MENU_OPEN);
return WM_UI_HANDLER_BREAK;
@@ -5748,7 +5749,7 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co
ui_apply_but(C, but->block, but, data, true);
return WM_UI_HANDLER_BREAK;
}
- else if ((int)(but->a1) == UI_PALETTE_COLOR && event->type == DELKEY &&
+ else if ((int)(but->a1) == UI_PALETTE_COLOR && event->type == EVT_DELKEY &&
event->val == KM_PRESS) {
Palette *palette = (Palette *)but->rnapoin.owner_id;
PaletteColor *color = but->rnapoin.data;
@@ -5874,7 +5875,7 @@ static int ui_do_but_UNITVEC(
}
}
}
- else if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
+ else if (event->type == EVT_ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -6167,7 +6168,7 @@ static int ui_do_but_HSVCUBE(
}
#endif /* WITH_INPUT_NDOF */
/* XXX hardcoded keymap check.... */
- else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) {
if (ELEM(but->a1, UI_GRAD_V_ALT, UI_GRAD_L_ALT)) {
int len;
@@ -6199,7 +6200,7 @@ static int ui_do_but_HSVCUBE(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
+ if (event->type == EVT_ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -6443,7 +6444,7 @@ static int ui_do_but_HSVCIRCLE(
}
#endif /* WITH_INPUT_NDOF */
/* XXX hardcoded keymap check.... */
- else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) {
int len;
/* reset only saturation */
@@ -6474,7 +6475,7 @@ static int ui_do_but_HSVCIRCLE(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
+ if (event->type == EVT_ESCKEY || event->type == RIGHTMOUSE) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -6598,7 +6599,7 @@ static int ui_do_but_COLORBAND(
else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
- else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
+ else if (ELEM(event->type, EVT_ESCKEY, RIGHTMOUSE)) {
if (event->val == KM_PRESS) {
data->dragcbd->pos = data->dragfstart;
BKE_colorband_update_sort(data->coba);
@@ -7024,7 +7025,7 @@ static int ui_do_but_CURVEPROFILE(
ui_window_to_block(data->region, block, &mx, &my);
/* Move selected control points. */
- if (event->type == GKEY && event->val == KM_RELEASE) {
+ if (event->type == EVT_GKEY && event->val == KM_RELEASE) {
data->dragstartx = mx;
data->dragstarty = my;
data->draglastx = mx;
@@ -7036,7 +7037,7 @@ static int ui_do_but_CURVEPROFILE(
CurveProfile *profile = (CurveProfile *)but->poin;
/* Delete selected control points. */
- if (event->type == XKEY && event->val == KM_RELEASE) {
+ if (event->type == EVT_XKEY && event->val == KM_RELEASE) {
BKE_curveprofile_remove_by_flag(profile, PROF_SELECT);
BKE_curveprofile_update(profile, false);
button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -7213,7 +7214,7 @@ static int ui_do_but_HISTOGRAM(
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) {
Histogram *hist = (Histogram *)but->poin;
hist->ymax = 1.f;
@@ -7222,7 +7223,7 @@ static int ui_do_but_HISTOGRAM(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY) {
+ if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -7289,7 +7290,7 @@ static int ui_do_but_WAVEFORM(
return WM_UI_HANDLER_BREAK;
}
/* XXX hardcoded keymap check.... */
- else if (event->type == BACKSPACEKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS) {
Scopes *scopes = (Scopes *)but->poin;
scopes->wavefrm_yfac = 1.f;
@@ -7298,7 +7299,7 @@ static int ui_do_but_WAVEFORM(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY) {
+ if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -7384,7 +7385,7 @@ static int ui_do_but_TRACKPREVIEW(
}
}
else if (data->state == BUTTON_STATE_NUM_EDITING) {
- if (event->type == ESCKEY) {
+ if (event->type == EVT_ESCKEY) {
if (event->val == KM_PRESS) {
data->cancel = true;
data->escapecancel = true;
@@ -7428,8 +7429,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
/* handle copy and paste */
bool is_press_ctrl_but_no_shift = event->val == KM_PRESS && IS_EVENT_MOD(event, ctrl, oskey) &&
!event->shift;
- bool do_copy = event->type == CKEY && is_press_ctrl_but_no_shift;
- bool do_paste = event->type == VKEY && is_press_ctrl_but_no_shift;
+ bool do_copy = event->type == EVT_CKEY && is_press_ctrl_but_no_shift;
+ bool do_paste = event->type == EVT_VKEY && is_press_ctrl_but_no_shift;
/* Specific handling for listrows, we try to find their overlapping tex button. */
if ((do_copy || do_paste) && but->type == UI_BTYPE_LISTROW) {
@@ -7470,7 +7471,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
}
if ((data->state == BUTTON_STATE_HIGHLIGHT) &&
- ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, PADENTER, RETKEY) &&
+ ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, EVT_PADENTER, EVT_RETKEY) &&
(event->val == KM_RELEASE) &&
/* Only returns true if the event was handled. */
ui_do_but_extra_operator_icon(C, but, data, event)) {
@@ -7602,7 +7603,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
data = but->active;
if (data && data->state == BUTTON_STATE_HIGHLIGHT) {
if ((retval == WM_UI_HANDLER_CONTINUE) &&
- (event->type == BACKSPACEKEY && event->val == KM_PRESS)) {
+ (event->type == EVT_BACKSPACEKEY && event->val == KM_PRESS)) {
/* ctrl+backspace = reset active button; backspace = reset a whole array*/
ui_but_default_set(C, !event->ctrl, true);
ED_region_tag_redraw(data->region);
@@ -8896,7 +8897,8 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi
}
if (val == KM_PRESS) {
- if ((ELEM(type, UPARROWKEY, DOWNARROWKEY) && !IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) ||
+ if ((ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY) &&
+ !IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) ||
((ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE) && event->ctrl &&
!IS_EVENT_MOD(event, shift, alt, oskey)))) {
const int value_orig = RNA_property_int_get(&listbox->rnapoin, listbox->rnaprop);
@@ -8905,10 +8907,10 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi
/* activate up/down the list */
value = value_orig;
if ((ui_list->filter_sort_flag & UILST_FLT_SORT_REVERSE) != 0) {
- inc = ELEM(type, UPARROWKEY, WHEELUPMOUSE) ? 1 : -1;
+ inc = ELEM(type, EVT_UPARROWKEY, WHEELUPMOUSE) ? 1 : -1;
}
else {
- inc = ELEM(type, UPARROWKEY, WHEELUPMOUSE) ? -1 : 1;
+ inc = ELEM(type, EVT_UPARROWKEY, WHEELUPMOUSE) ? -1 : 1;
}
if (dyn_data->items_filter_neworder || dyn_data->items_filter_flags) {
@@ -9563,7 +9565,7 @@ static int ui_handle_menu_event(bContext *C,
break;
/* Closing sub-levels of pull-downs. */
- case LEFTARROWKEY:
+ case EVT_LEFTARROWKEY:
if (event->val == KM_PRESS && (block->flag & UI_BLOCK_LOOP)) {
if (block->saferct.first) {
menu->menuretval = UI_RETURN_OUT;
@@ -9574,7 +9576,7 @@ static int ui_handle_menu_event(bContext *C,
break;
/* Opening sub-levels of pull-downs. */
- case RIGHTARROWKEY:
+ case EVT_RIGHTARROWKEY:
if (event->val == KM_PRESS && (block->flag & UI_BLOCK_LOOP)) {
if (ui_menu_pass_event_to_parent_if_nonactive(menu, but, level, retval)) {
@@ -9630,12 +9632,12 @@ static int ui_handle_menu_event(bContext *C,
}
ATTR_FALLTHROUGH;
}
- case UPARROWKEY:
- case DOWNARROWKEY:
- case PAGEUPKEY:
- case PAGEDOWNKEY:
- case HOMEKEY:
- case ENDKEY:
+ case EVT_UPARROWKEY:
+ case EVT_DOWNARROWKEY:
+ case EVT_PAGEUPKEY:
+ case EVT_PAGEDOWNKEY:
+ case EVT_HOMEKEY:
+ case EVT_ENDKEY:
/* arrowkeys: only handle for block_loop blocks */
if (IS_EVENT_MOD(event, shift, ctrl, alt, oskey)) {
/* pass */
@@ -9654,13 +9656,13 @@ static int ui_handle_menu_event(bContext *C,
uiMenuScrollType scrolltype;
bool ui_block_flipped = (block->flag & UI_BLOCK_IS_FLIP) != 0;
- if (ELEM(type, PAGEUPKEY, HOMEKEY)) {
+ if (ELEM(type, EVT_PAGEUPKEY, EVT_HOMEKEY)) {
scrolltype = ui_block_flipped ? MENU_SCROLL_TOP : MENU_SCROLL_BOTTOM;
}
- else if (ELEM(type, PAGEDOWNKEY, ENDKEY)) {
+ else if (ELEM(type, EVT_PAGEDOWNKEY, EVT_ENDKEY)) {
scrolltype = ui_block_flipped ? MENU_SCROLL_BOTTOM : MENU_SCROLL_TOP;
}
- else if (ELEM(type, UPARROWKEY, WHEELUPMOUSE)) {
+ else if (ELEM(type, EVT_UPARROWKEY, WHEELUPMOUSE)) {
scrolltype = ui_block_flipped ? MENU_SCROLL_UP : MENU_SCROLL_DOWN;
}
else {
@@ -9709,60 +9711,60 @@ static int ui_handle_menu_event(bContext *C,
break;
- case ONEKEY:
- case PAD1:
+ case EVT_ONEKEY:
+ case EVT_PAD1:
act = 1;
ATTR_FALLTHROUGH;
- case TWOKEY:
- case PAD2:
+ case EVT_TWOKEY:
+ case EVT_PAD2:
if (act == 0) {
act = 2;
}
ATTR_FALLTHROUGH;
- case THREEKEY:
- case PAD3:
+ case EVT_THREEKEY:
+ case EVT_PAD3:
if (act == 0) {
act = 3;
}
ATTR_FALLTHROUGH;
- case FOURKEY:
- case PAD4:
+ case EVT_FOURKEY:
+ case EVT_PAD4:
if (act == 0) {
act = 4;
}
ATTR_FALLTHROUGH;
- case FIVEKEY:
- case PAD5:
+ case EVT_FIVEKEY:
+ case EVT_PAD5:
if (act == 0) {
act = 5;
}
ATTR_FALLTHROUGH;
- case SIXKEY:
- case PAD6:
+ case EVT_SIXKEY:
+ case EVT_PAD6:
if (act == 0) {
act = 6;
}
ATTR_FALLTHROUGH;
- case SEVENKEY:
- case PAD7:
+ case EVT_SEVENKEY:
+ case EVT_PAD7:
if (act == 0) {
act = 7;
}
ATTR_FALLTHROUGH;
- case EIGHTKEY:
- case PAD8:
+ case EVT_EIGHTKEY:
+ case EVT_PAD8:
if (act == 0) {
act = 8;
}
ATTR_FALLTHROUGH;
- case NINEKEY:
- case PAD9:
+ case EVT_NINEKEY:
+ case EVT_PAD9:
if (act == 0) {
act = 9;
}
ATTR_FALLTHROUGH;
- case ZEROKEY:
- case PAD0:
+ case EVT_ZEROKEY:
+ case EVT_PAD0:
if (act == 0) {
act = 10;
}
@@ -9823,32 +9825,32 @@ static int ui_handle_menu_event(bContext *C,
break;
/* Handle keystrokes on menu items */
- case AKEY:
- case BKEY:
- case CKEY:
- case DKEY:
- case EKEY:
- case FKEY:
- case GKEY:
- case HKEY:
- case IKEY:
- case JKEY:
- case KKEY:
- case LKEY:
- case MKEY:
- case NKEY:
- case OKEY:
- case PKEY:
- case QKEY:
- case RKEY:
- case SKEY:
- case TKEY:
- case UKEY:
- case VKEY:
- case WKEY:
- case XKEY:
- case YKEY:
- case ZKEY: {
+ case EVT_AKEY:
+ case EVT_BKEY:
+ case EVT_CKEY:
+ case EVT_DKEY:
+ case EVT_EKEY:
+ case EVT_FKEY:
+ case EVT_GKEY:
+ case EVT_HKEY:
+ case EVT_IKEY:
+ case EVT_JKEY:
+ case EVT_KKEY:
+ case EVT_LKEY:
+ case EVT_MKEY:
+ case EVT_NKEY:
+ case EVT_OKEY:
+ case EVT_PKEY:
+ case EVT_QKEY:
+ case EVT_RKEY:
+ case EVT_SKEY:
+ case EVT_TKEY:
+ case EVT_UKEY:
+ case EVT_VKEY:
+ case EVT_WKEY:
+ case EVT_XKEY:
+ case EVT_YKEY:
+ case EVT_ZKEY: {
if ((event->val == KM_PRESS || event->val == KM_DBL_CLICK) &&
!IS_EVENT_MOD(event, shift, ctrl, oskey)) {
if (ui_menu_pass_event_to_parent_if_nonactive(menu, but, level, retval)) {
@@ -9930,11 +9932,11 @@ static int ui_handle_menu_event(bContext *C,
retval = WM_UI_HANDLER_BREAK;
}
#endif
- else if (event->type == ESCKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_ESCKEY && event->val == KM_PRESS) {
/* Escape cancels this and all preceding menus. */
menu->menuretval = UI_RETURN_CANCEL;
}
- else if (ELEM(event->type, RETKEY, PADENTER) && event->val == KM_PRESS) {
+ else if (ELEM(event->type, EVT_RETKEY, EVT_PADENTER) && event->val == KM_PRESS) {
uiBut *but_default = ui_region_find_first_but_test_flag(
region, UI_BUT_ACTIVE_DEFAULT, UI_HIDDEN);
if ((but_default != NULL) && (but_default->active == NULL)) {
@@ -10367,37 +10369,37 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
}
break;
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
menu->menuretval = UI_RETURN_CANCEL;
break;
- case AKEY:
- case BKEY:
- case CKEY:
- case DKEY:
- case EKEY:
- case FKEY:
- case GKEY:
- case HKEY:
- case IKEY:
- case JKEY:
- case KKEY:
- case LKEY:
- case MKEY:
- case NKEY:
- case OKEY:
- case PKEY:
- case QKEY:
- case RKEY:
- case SKEY:
- case TKEY:
- case UKEY:
- case VKEY:
- case WKEY:
- case XKEY:
- case YKEY:
- case ZKEY: {
+ case EVT_AKEY:
+ case EVT_BKEY:
+ case EVT_CKEY:
+ case EVT_DKEY:
+ case EVT_EKEY:
+ case EVT_FKEY:
+ case EVT_GKEY:
+ case EVT_HKEY:
+ case EVT_IKEY:
+ case EVT_JKEY:
+ case EVT_KKEY:
+ case EVT_LKEY:
+ case EVT_MKEY:
+ case EVT_NKEY:
+ case EVT_OKEY:
+ case EVT_PKEY:
+ case EVT_QKEY:
+ case EVT_RKEY:
+ case EVT_SKEY:
+ case EVT_TKEY:
+ case EVT_UKEY:
+ case EVT_VKEY:
+ case EVT_WKEY:
+ case EVT_XKEY:
+ case EVT_YKEY:
+ case EVT_ZKEY: {
if ((event->val == KM_PRESS || event->val == KM_DBL_CLICK) &&
!IS_EVENT_MOD(event, shift, ctrl, oskey)) {
for (but = block->buttons.first; but; but = but->next) {
@@ -10410,8 +10412,8 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
}
#define CASE_NUM_TO_DIR(n, d) \
- case (ZEROKEY + n): \
- case (PAD0 + n): { \
+ case (EVT_ZEROKEY + n): \
+ case (EVT_PAD0 + n): { \
if (num_dir == UI_RADIAL_NONE) \
num_dir = d; \
} \
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 3173c962830..1984372f398 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -567,14 +567,14 @@ static DrawInfo *g_di_event_list = NULL;
int UI_icon_from_event_type(short event_type, short event_value)
{
- if (event_type == RIGHTSHIFTKEY) {
- event_type = LEFTSHIFTKEY;
+ if (event_type == EVT_RIGHTSHIFTKEY) {
+ event_type = EVT_LEFTSHIFTKEY;
}
- else if (event_type == RIGHTCTRLKEY) {
- event_type = LEFTCTRLKEY;
+ else if (event_type == EVT_RIGHTCTRLKEY) {
+ event_type = EVT_LEFTCTRLKEY;
}
- else if (event_type == RIGHTALTKEY) {
- event_type = LEFTALTKEY;
+ else if (event_type == EVT_RIGHTALTKEY) {
+ event_type = EVT_LEFTALTKEY;
}
else if (event_type == EVT_TWEAK_L) {
event_type = LEFTMOUSE;
@@ -648,54 +648,54 @@ static void init_event_icons(void)
const int w = 16; /* DUMMY */
- INIT_EVENT_ICON(ICON_EVENT_A, AKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_B, BKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_C, CKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_D, DKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_E, EKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F, FKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_G, GKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_H, HKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_I, IKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_J, JKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_K, KKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_L, LKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_M, MKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_N, NKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_O, OKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_P, PKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_Q, QKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_R, RKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_S, SKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_T, TKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_U, UKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_V, VKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_W, WKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_X, XKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_Y, YKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_Z, ZKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_SHIFT, LEFTSHIFTKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_CTRL, LEFTCTRLKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_ALT, LEFTALTKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_OS, OSKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F1, F1KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F2, F2KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F3, F3KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F4, F4KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F5, F5KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F6, F6KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F7, F7KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F8, F8KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F9, F9KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F10, F10KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F11, F11KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_F12, F12KEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_ESC, ESCKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_TAB, TABKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_PAGEUP, PAGEUPKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_PAGEDOWN, PAGEDOWNKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_RETURN, RETKEY, KM_ANY);
- INIT_EVENT_ICON(ICON_EVENT_SPACEKEY, SPACEKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_A, EVT_AKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_B, EVT_BKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_C, EVT_CKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_D, EVT_DKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_E, EVT_EKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F, EVT_FKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_G, EVT_GKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_H, EVT_HKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_I, EVT_IKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_J, EVT_JKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_K, EVT_KKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_L, EVT_LKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_M, EVT_MKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_N, EVT_NKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_O, EVT_OKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_P, EVT_PKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_Q, EVT_QKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_R, EVT_RKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_S, EVT_SKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_T, EVT_TKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_U, EVT_UKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_V, EVT_VKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_W, EVT_WKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_X, EVT_XKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_Y, EVT_YKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_Z, EVT_ZKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_SHIFT, EVT_LEFTSHIFTKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_CTRL, EVT_LEFTCTRLKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_ALT, EVT_LEFTALTKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_OS, EVT_OSKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F1, EVT_F1KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F2, EVT_F2KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F3, EVT_F3KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F4, EVT_F4KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F5, EVT_F5KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F6, EVT_F6KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F7, EVT_F7KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F8, EVT_F8KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F9, EVT_F9KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F10, EVT_F10KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F11, EVT_F11KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_F12, EVT_F12KEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_ESC, EVT_ESCKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_TAB, EVT_TABKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_PAGEUP, EVT_PAGEUPKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_PAGEDOWN, EVT_PAGEDOWNKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_RETURN, EVT_RETKEY, KM_ANY);
+ INIT_EVENT_ICON(ICON_EVENT_SPACEKEY, EVT_SPACEKEY, KM_ANY);
g_di_event_list = di_next;
diff --git a/source/blender/editors/interface/interface_icons_event.c b/source/blender/editors/interface/interface_icons_event.c
index 9a967c3b8f3..9398d1c0cd4 100644
--- a/source/blender/editors/interface/interface_icons_event.c
+++ b/source/blender/editors/interface/interface_icons_event.c
@@ -142,19 +142,19 @@ void icon_draw_rect_input(float x,
.ymax = y + h,
};
- if ((event_type >= AKEY) && (event_type <= ZKEY)) {
- char str[2] = {'A' + (event_type - AKEY), '\0'};
+ if ((event_type >= EVT_AKEY) && (event_type <= EVT_ZKEY)) {
+ char str[2] = {'A' + (event_type - EVT_AKEY), '\0'};
icon_draw_rect_input_text(&rect, color, str, 13);
}
- else if ((event_type >= F1KEY) && (event_type <= F12KEY)) {
+ else if ((event_type >= EVT_F1KEY) && (event_type <= EVT_F12KEY)) {
char str[4];
- SNPRINTF(str, "F%d", 1 + (event_type - F1KEY));
- icon_draw_rect_input_text(&rect, color, str, event_type > F9KEY ? 8 : 10);
+ SNPRINTF(str, "F%d", 1 + (event_type - EVT_F1KEY));
+ icon_draw_rect_input_text(&rect, color, str, event_type > EVT_F9KEY ? 8 : 10);
}
- else if (event_type == LEFTSHIFTKEY) {
+ else if (event_type == EVT_LEFTSHIFTKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x87, 0xa7, 0x0});
}
- else if (event_type == LEFTCTRLKEY) {
+ else if (event_type == EVT_LEFTCTRLKEY) {
if (platform == MACOS) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x8c, 0x83, 0x0});
}
@@ -162,7 +162,7 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "Ctrl", 9);
}
}
- else if (event_type == LEFTALTKEY) {
+ else if (event_type == EVT_LEFTALTKEY) {
if (platform == MACOS) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x8c, 0xa5, 0x0});
}
@@ -170,7 +170,7 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "Alt", 10);
}
}
- else if (event_type == OSKEY) {
+ else if (event_type == EVT_OSKEY) {
if (platform == MACOS) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x8c, 0x98, 0x0});
}
@@ -181,22 +181,22 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "OS", 10);
}
}
- else if (event_type == DELKEY) {
+ else if (event_type == EVT_DELKEY) {
icon_draw_rect_input_text(&rect, color, "Del", 9);
}
- else if (event_type == TABKEY) {
+ else if (event_type == EVT_TABKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0xad, 0xbe, 0x0});
}
- else if (event_type == HOMEKEY) {
+ else if (event_type == EVT_HOMEKEY) {
icon_draw_rect_input_text(&rect, color, "Home", 6);
}
- else if (event_type == ENDKEY) {
+ else if (event_type == EVT_ENDKEY) {
icon_draw_rect_input_text(&rect, color, "End", 8);
}
- else if (event_type == RETKEY) {
+ else if (event_type == EVT_RETKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x8f, 0x8e, 0x0});
}
- else if (event_type == ESCKEY) {
+ else if (event_type == EVT_ESCKEY) {
if (platform == MACOS) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x8e, 0x8b, 0x0});
}
@@ -204,25 +204,25 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "Esc", 8);
}
}
- else if (event_type == PAGEUPKEY) {
+ else if (event_type == EVT_PAGEUPKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){'P', 0xe2, 0x86, 0x91, 0x0}, 8);
}
- else if (event_type == PAGEDOWNKEY) {
+ else if (event_type == EVT_PAGEDOWNKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){'P', 0xe2, 0x86, 0x93, 0x0}, 8);
}
- else if (event_type == LEFTARROWKEY) {
+ else if (event_type == EVT_LEFTARROWKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x86, 0x90, 0x0});
}
- else if (event_type == UPARROWKEY) {
+ else if (event_type == EVT_UPARROWKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x86, 0x91, 0x0});
}
- else if (event_type == RIGHTARROWKEY) {
+ else if (event_type == EVT_RIGHTARROWKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x86, 0x92, 0x0});
}
- else if (event_type == DOWNARROWKEY) {
+ else if (event_type == EVT_DOWNARROWKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x86, 0x93, 0x0});
}
- else if (event_type == SPACEKEY) {
+ else if (event_type == EVT_SPACEKEY) {
icon_draw_rect_input_symbol(&rect, color, (const char[]){0xe2, 0x90, 0xa3, 0x0});
}
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 1f5855aed9e..6e56dd96cb0 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1584,13 +1584,13 @@ static void ui_handle_panel_header(
/* XXX weak code, currently it assumes layout style for location of widgets */
/* check open/collapsed button */
- if (event == RETKEY) {
+ if (event == EVT_RETKEY) {
button = 1;
}
- else if (event == AKEY) {
+ else if (event == EVT_AKEY) {
button = 1;
}
- else if (ELEM(event, 0, RETKEY, LEFTMOUSE) && shift) {
+ else if (ELEM(event, 0, EVT_RETKEY, LEFTMOUSE) && shift) {
if (block->panel->type->parent == NULL) {
block->panel->flag ^= PNL_PIN;
button = 2;
@@ -2305,7 +2305,7 @@ int ui_handler_panel_region(bContext *C,
retval = WM_UI_HANDLER_BREAK;
}
}
- else if ((event->type == TABKEY && event->ctrl) ||
+ else if ((event->type == EVT_TABKEY && event->ctrl) ||
ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE)) {
/* cycle tabs */
retval = ui_handle_panel_category_cycling(event, region, active_but);
@@ -2340,7 +2340,8 @@ int ui_handler_panel_region(bContext *C,
/* XXX hardcoded key warning */
if (ELEM(mouse_state, PANEL_MOUSE_INSIDE_CONTENT, PANEL_MOUSE_INSIDE_HEADER) &&
event->val == KM_PRESS) {
- if (event->type == AKEY && ((event->ctrl + event->oskey + event->shift + event->alt) == 0)) {
+ if (event->type == EVT_AKEY &&
+ ((event->ctrl + event->oskey + event->shift + event->alt) == 0)) {
if (pa->flag & PNL_CLOSEDY) {
if ((block->rect.ymax <= my) && (block->rect.ymax + PNL_HEADER >= my)) {
@@ -2366,9 +2367,9 @@ int ui_handler_panel_region(bContext *C,
if (event->val == KM_PRESS) {
/* open close on header */
- if (ELEM(event->type, RETKEY, PADENTER)) {
+ if (ELEM(event->type, EVT_RETKEY, EVT_PADENTER)) {
if (mouse_state == PANEL_MOUSE_INSIDE_HEADER) {
- ui_handle_panel_header(C, block, mx, my, RETKEY, event->ctrl, event->shift);
+ ui_handle_panel_header(C, block, mx, my, EVT_RETKEY, event->ctrl, event->shift);
retval = WM_UI_HANDLER_BREAK;
break;
}
@@ -2395,7 +2396,7 @@ int ui_handler_panel_region(bContext *C,
break;
}
}
- else if (event->type == ESCKEY) {
+ else if (event->type == EVT_ESCKEY) {
/*XXX 2.50*/
#if 0
if (block->handler) {
@@ -2405,7 +2406,7 @@ int ui_handler_panel_region(bContext *C,
}
#endif
}
- else if (event->type == PADPLUSKEY || event->type == PADMINUS) {
+ else if (event->type == EVT_PADPLUSKEY || event->type == EVT_PADMINUS) {
#if 0 /* XXX make float panel exception? */
int zoom = 0;
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 89eb0658d5e..b10d5be5136 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -283,11 +283,11 @@ void ui_searchbox_event(bContext *C, ARegion *region, uiBut *but, const wmEvent
switch (type) {
case WHEELUPMOUSE:
- case UPARROWKEY:
+ case EVT_UPARROWKEY:
ui_searchbox_select(C, region, but, -1);
break;
case WHEELDOWNMOUSE:
- case DOWNARROWKEY:
+ case EVT_DOWNARROWKEY:
ui_searchbox_select(C, region, but, 1);
break;
case MOUSEMOVE:
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 2c9803d1dd3..8116029af59 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -306,7 +306,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
#endif
default:
- if (event->type == vpd->invoke_event || event->type == ESCKEY) {
+ if (event->type == vpd->invoke_event || event->type == EVT_ESCKEY) {
if (event->val == KM_RELEASE) {
/* calculate overall delta mouse-movement for redo */
RNA_int_set(op->ptr, "deltax", (vpd->startx - vpd->lastx));
@@ -1244,7 +1244,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event
/* apply zooming */
view_zoomdrag_apply(C, op);
}
- else if (event->type == vzd->invoke_event || event->type == ESCKEY) {
+ else if (event->type == vzd->invoke_event || event->type == EVT_ESCKEY) {
if (event->val == KM_RELEASE) {
/* for redo, store the overall deltas - need to respect zoom-locks here... */
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 50f7466f7ed..4d3283e608b 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -932,11 +932,11 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
float co[2];
switch (event->type) {
- case LEFTALTKEY:
- case RIGHTALTKEY:
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- if (ELEM(event->type, LEFTALTKEY, RIGHTALTKEY)) {
+ case EVT_LEFTALTKEY:
+ case EVT_RIGHTALTKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
+ if (ELEM(event->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY)) {
if (data->action == SLIDE_ACTION_FEATHER) {
data->is_overall_feather = (event->val == KM_PRESS);
}
@@ -945,7 +945,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
}
- if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) {
+ if (ELEM(event->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) {
data->is_accurate = (event->val == KM_PRESS);
}
@@ -1165,7 +1165,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
}
- case ESCKEY:
+ case EVT_ESCKEY:
cancel_slide_point(op->customdata);
WM_event_add_notifier(C, NC_MASK | NA_EDITED, data->mask);
@@ -1419,15 +1419,15 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve
float u = slide_data->u;
switch (event->type) {
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
- if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) {
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
+ case EVT_LEFTCTRLKEY:
+ case EVT_RIGHTCTRLKEY:
+ if (ELEM(event->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) {
slide_data->accurate = (event->val == KM_PRESS);
}
- if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY)) {
+ if (ELEM(event->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY)) {
if (event->val == KM_PRESS) {
slide_data->adjust_bezt->h1 = slide_data->adjust_bezt->h2 = HD_FREE;
if ((u > margin && u < 0.5f) || (u >= 0.5f && u < 1.0f - margin)) {
@@ -1551,7 +1551,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve
break;
- case ESCKEY:
+ case EVT_ESCKEY:
cancel_slide_spline_curvature(slide_data);
WM_event_add_notifier(C, NC_MASK | NA_EDITED, slide_data->mask);
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 23a108e816a..ea1942dee5f 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -401,7 +401,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
else {
bool handled = false;
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
edbm_inset_cancel(C, op);
return OPERATOR_CANCELLED;
@@ -450,8 +450,8 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
case LEFTMOUSE:
- case PADENTER:
- case RETKEY:
+ case EVT_PADENTER:
+ case EVT_RETKEY:
if ((event->val == KM_PRESS) ||
((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) {
edbm_inset_calc(op);
@@ -459,8 +459,8 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_FINISHED;
}
break;
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
if (event->val == KM_PRESS) {
if (opdata->modify_depth) {
opdata->shift_amount = RNA_float_get(op->ptr, "depth");
@@ -478,8 +478,8 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
break;
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY: {
+ case EVT_LEFTCTRLKEY:
+ case EVT_RIGHTCTRLKEY: {
float mlen[2];
mlen[0] = opdata->mcenter[0] - event->mval[0];
@@ -506,7 +506,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
}
- case OKEY:
+ case EVT_OKEY:
if (event->val == KM_PRESS) {
const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
RNA_boolean_set(op->ptr, "use_outset", !use_outset);
@@ -520,7 +520,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
handled = true;
}
break;
- case BKEY:
+ case EVT_BKEY:
if (event->val == KM_PRESS) {
const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary");
RNA_boolean_set(op->ptr, "use_boundary", !use_boundary);
@@ -534,7 +534,7 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event)
handled = true;
}
break;
- case IKEY:
+ case EVT_IKEY:
if (event->val == KM_PRESS) {
const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
RNA_boolean_set(op->ptr, "use_individual", !use_individual);
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 9509a0af2bc..066b692e1ff 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -536,8 +536,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
else {
bool handled = false;
switch (event->type) {
- case RETKEY:
- case PADENTER:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
case LEFTMOUSE: /* confirm */ // XXX hardcoded
if (event->val == KM_PRESS) {
return loopcut_finish(lcd, C, op);
@@ -552,7 +552,7 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
ED_workspace_status_text(C, NULL);
return OPERATOR_CANCELLED;
- case ESCKEY:
+ case EVT_ESCKEY:
if (event->val == KM_RELEASE) {
/* cancel */
ED_region_tag_redraw(lcd->region);
@@ -577,8 +577,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
handled = true;
break;
- case PADPLUSKEY:
- case PAGEUPKEY:
+ case EVT_PADPLUSKEY:
+ case EVT_PAGEUPKEY:
case WHEELUPMOUSE: /* change number of cuts */
if (event->val == KM_RELEASE) {
break;
@@ -591,8 +591,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
handled = true;
break;
- case PADMINUS:
- case PAGEDOWNKEY:
+ case EVT_PADMINUS:
+ case EVT_PAGEDOWNKEY:
case WHEELDOWNMOUSE: /* change number of cuts */
if (event->val == KM_RELEASE) {
break;
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index bc79521ee9b..6f659858ac2 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -596,7 +596,7 @@ static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const
/* running render */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 46df7e6e1d4..8cfcad2d77e 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -143,7 +143,7 @@ static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
/* running render */
switch (event->type) {
- case ESCKEY: {
+ case EVT_ESCKEY: {
G.is_break = true;
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 3b1fb49c383..4a085bb61bf 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -1995,7 +1995,7 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
}
}
else {
- if (ELEM(event->type, LEFTMOUSE, RETKEY, PADENTER)) {
+ if (ELEM(event->type, LEFTMOUSE, EVT_RETKEY, EVT_PADENTER)) {
is_finished = true;
}
}
@@ -2004,7 +2004,7 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
object_transform_axis_target_free_data(op);
return OPERATOR_FINISHED;
}
- else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
+ else if (ELEM(event->type, EVT_ESCKEY, RIGHTMOUSE)) {
object_transform_axis_target_cancel(C, op);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 2db5eb784c0..0b754780cde 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -606,7 +606,7 @@ static int fluid_bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *
}
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index f37d2cf9a76..f687120d228 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -844,7 +844,7 @@ static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event
/* running render */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index c48d5917ec2..6baf8cdba07 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -1222,7 +1222,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent
bool ret;
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
/* cancel */
oglrender->pool_ok = false; /* Flag pool for cancel. */
screen_opengl_render_end(C, op->customdata);
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 95d044554f1..d022de0545f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -918,7 +918,7 @@ static int light_cache_bake_modal(bContext *C, wmOperator *op, const wmEvent *ev
/* running render */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
return OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index a72b18f63f8..2fe34d61a04 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1090,7 +1090,7 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
break;
}
- case ESCKEY:
+ case EVT_ESCKEY:
actionzone_exit(op);
return OPERATOR_CANCELLED;
case LEFTMOUSE:
@@ -1270,7 +1270,7 @@ static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
break;
- case ESCKEY:
+ case EVT_ESCKEY:
area_swap_cancel(C, op);
return OPERATOR_CANCELLED;
}
@@ -2335,7 +2335,7 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
case MIDDLEMOUSE:
- case TABKEY:
+ case EVT_TABKEY:
if (sd->previewmode == 0) {
/* pass */
}
@@ -2353,11 +2353,11 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
case RIGHTMOUSE: /* cancel operation */
- case ESCKEY:
+ case EVT_ESCKEY:
area_split_cancel(C, op);
return OPERATOR_CANCELLED;
- case LEFTCTRLKEY:
+ case EVT_LEFTCTRLKEY:
sd->do_snap = event->val == KM_PRESS;
update_factor = true;
break;
@@ -2757,7 +2757,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
break;
- case ESCKEY:
+ case EVT_ESCKEY:
break;
}
@@ -3473,7 +3473,7 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
case RIGHTMOUSE:
- case ESCKEY:
+ case EVT_ESCKEY:
area_join_cancel(C, op);
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index fed3c2f03a4..6f0ee3626e4 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1013,14 +1013,14 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
case MOUSEMOVE:
stencil_control_calculate(scd, event->mval);
break;
- case ESCKEY:
+ case EVT_ESCKEY:
if (event->val == KM_PRESS) {
stencil_control_cancel(C, op);
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_CANCELLED;
}
break;
- case XKEY:
+ case EVT_XKEY:
if (event->val == KM_PRESS) {
if (scd->constrain_mode == STENCIL_CONSTRAINT_X) {
@@ -1033,7 +1033,7 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
stencil_control_calculate(scd, event->mval);
}
break;
- case YKEY:
+ case EVT_YKEY:
if (event->val == KM_PRESS) {
if (scd->constrain_mode == STENCIL_CONSTRAINT_Y) {
scd->constrain_mode = 0;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index ee114d5f662..0e194e57538 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -1449,7 +1449,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_FINISHED;
}
}
- else if (ELEM(event->type, RETKEY, SPACEKEY)) {
+ else if (ELEM(event->type, EVT_RETKEY, EVT_SPACEKEY)) {
paint_stroke_line_end(C, op, stroke, sample_average.mouse);
stroke_done(C, op);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 14c11523455..1f05b3b944e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -10067,7 +10067,7 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
mask_expand_update_it = ss->filter_cache->mask_update_it[(int)SCULPT_active_vertex_get(ss)];
}
- if ((event->type == ESCKEY && event->val == KM_PRESS) ||
+ if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) ||
(event->type == RIGHTMOUSE && event->val == KM_PRESS)) {
/* Returning OPERATOR_CANCELLED will leak memory due to not finishing
* undo. Better solution could be to make paint_mesh_restore_co work
@@ -10077,8 +10077,8 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
}
if ((event->type == LEFTMOUSE && event->val == KM_RELEASE) ||
- (event->type == RETKEY && event->val == KM_PRESS) ||
- (event->type == PADENTER && event->val == KM_PRESS)) {
+ (event->type == EVT_RETKEY && event->val == KM_PRESS) ||
+ (event->type == EVT_PADENTER && event->val == KM_PRESS)) {
/* Smooth iterations. */
SculptThreadedTaskData data = {
@@ -10148,7 +10148,7 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent *
mask_expand_update_it = ss->filter_cache->mask_update_last_it - 1;
}
- if (!ELEM(event->type, MOUSEMOVE, LEFTCTRLKEY, RIGHTCTRLKEY)) {
+ if (!ELEM(event->type, MOUSEMOVE, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY)) {
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index c6033ec6ca0..0f978b38e60 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -484,11 +484,11 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
RNA_float_set_array(op->ptr, "offset", offset);
view_pan_exec(C, op);
break;
- case ESCKEY:
+ case EVT_ESCKEY:
view_pan_exit(C, op, 1);
return OPERATOR_CANCELLED;
- case SPACEKEY:
+ case EVT_SPACEKEY:
view_pan_exit(C, op, 0);
return OPERATOR_FINISHED;
@@ -1136,7 +1136,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event
static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_FINISHED;
case MOUSEMOVE:
@@ -1702,7 +1702,7 @@ static int clip_prefetch_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
/* running render */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index aab60f8bc6e..3c25be9fe1e 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -189,7 +189,7 @@ static int add_marker_at_click_modal(bContext *C, wmOperator *UNUSED(op), const
return OPERATOR_FINISHED;
}
- case ESCKEY:
+ case EVT_ESCKEY:
ED_workspace_status_text(C, NULL);
return OPERATOR_CANCELLED;
}
@@ -780,17 +780,17 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event)
float dx, dy, mdelta[2];
switch (event->type) {
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
+ case EVT_LEFTCTRLKEY:
+ case EVT_RIGHTCTRLKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
if (data->action == SLIDE_ACTION_SIZE) {
- if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY)) {
+ if (ELEM(event->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY)) {
data->lock = event->val == KM_RELEASE;
}
}
- if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) {
+ if (ELEM(event->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) {
data->accurate = event->val == KM_PRESS;
}
ATTR_FALLTHROUGH;
@@ -966,7 +966,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event)
break;
- case ESCKEY:
+ case EVT_ESCKEY:
cancel_mouse_slide(op->customdata);
free_slide_data(op->customdata);
diff --git a/source/blender/editors/space_clip/tracking_ops_plane.c b/source/blender/editors/space_clip/tracking_ops_plane.c
index 00861ab0270..329dc8be894 100644
--- a/source/blender/editors/space_clip/tracking_ops_plane.c
+++ b/source/blender/editors/space_clip/tracking_ops_plane.c
@@ -270,11 +270,11 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *
float next_edge[2], prev_edge[2], next_diag_edge[2], prev_diag_edge[2];
switch (event->type) {
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
- if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) {
+ case EVT_LEFTCTRLKEY:
+ case EVT_RIGHTCTRLKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
+ if (ELEM(event->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) {
data->accurate = event->val == KM_PRESS;
}
ATTR_FALLTHROUGH;
@@ -363,7 +363,7 @@ static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *
break;
- case ESCKEY:
+ case EVT_ESCKEY:
cancel_mouse_slide_plane_marker(op->customdata);
free_slide_plane_marker_data(op->customdata);
diff --git a/source/blender/editors/space_clip/tracking_ops_solve.c b/source/blender/editors/space_clip/tracking_ops_solve.c
index da3bf0ea8b3..b6c5c087025 100644
--- a/source/blender/editors/space_clip/tracking_ops_solve.c
+++ b/source/blender/editors/space_clip/tracking_ops_solve.c
@@ -261,7 +261,7 @@ static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent
/* Running solver. */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c
index adbb3e30850..f579b2a08e2 100644
--- a/source/blender/editors/space_clip/tracking_ops_track.c
+++ b/source/blender/editors/space_clip/tracking_ops_track.c
@@ -387,7 +387,7 @@ static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEven
/* Running tracking. */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_RUNNING_MODAL;
}
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 7580666c5f0..e9f9249e608 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1576,8 +1576,8 @@ static int graphkeys_decimate_modal(bContext *C, wmOperator *op, const wmEvent *
switch (event->type) {
case LEFTMOUSE: /* confirm */
- case RETKEY:
- case PADENTER: {
+ case EVT_RETKEY:
+ case EVT_PADENTER: {
if (event->val == KM_PRESS) {
decimate_exit(C, op);
@@ -1586,7 +1586,7 @@ static int graphkeys_decimate_modal(bContext *C, wmOperator *op, const wmEvent *
break;
}
- case ESCKEY: /* cancel */
+ case EVT_ESCKEY: /* cancel */
case RIGHTMOUSE: {
if (event->val == KM_PRESS) {
decimate_reset_bezts(dgo);
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 83aa0aa6eab..344688bbd21 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -176,7 +176,7 @@ static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *ev
/* execute the events */
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
if (screen) {
screen->scrubbing = false;
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index c62fd53431b..395329e5f6e 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3887,7 +3887,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event
static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
return OPERATOR_FINISHED;
case MOUSEMOVE:
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index e88b8a89b09..564d5f9c6b5 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1707,8 +1707,8 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
}
case LEFTMOUSE:
- case RETKEY:
- case SPACEKEY: {
+ case EVT_RETKEY:
+ case EVT_SPACEKEY: {
MEM_freeN(data->seq_array);
MEM_freeN(data->trim);
MEM_freeN(data->ts);
@@ -1722,7 +1722,7 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
return OPERATOR_FINISHED;
}
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE: {
int i;
Editing *ed = BKE_sequencer_editing_get(scene, false);
@@ -1754,8 +1754,8 @@ static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *even
return OPERATOR_CANCELLED;
}
- case RIGHTSHIFTKEY:
- case LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
if (!has_numInput) {
if (event->val == KM_PRESS) {
data->slow = true;
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index 97ce7035222..7a74cf9fe80 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -394,7 +394,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
draw = 1;
}
break;
- case ESCKEY:
+ case EVT_ESCKEY:
if (event->val == KM_PRESS) {
draw = swallow = 1;
if (tools & TOOL_SUGG_LIST) {
@@ -410,8 +410,8 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
retval = OPERATOR_CANCELLED;
}
break;
- case RETKEY:
- case PADENTER:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
ED_text_undo_push_init(C);
@@ -429,8 +429,8 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
retval = OPERATOR_FINISHED;
}
break;
- case LEFTARROWKEY:
- case BACKSPACEKEY:
+ case EVT_LEFTARROWKEY:
+ case EVT_BACKSPACEKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
if (event->ctrl) {
@@ -462,7 +462,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
}
}
break;
- case RIGHTARROWKEY:
+ case EVT_RIGHTARROWKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
if (event->ctrl) {
@@ -494,11 +494,11 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
}
}
break;
- case PAGEDOWNKEY:
+ case EVT_PAGEDOWNKEY:
scroll = SUGG_LIST_SIZE - 1;
ATTR_FALLTHROUGH;
case WHEELDOWNMOUSE:
- case DOWNARROWKEY:
+ case EVT_DOWNARROWKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_DOCUMENT) {
doc_scroll++;
@@ -528,11 +528,11 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
}
}
break;
- case PAGEUPKEY:
+ case EVT_PAGEUPKEY:
scroll = SUGG_LIST_SIZE - 1;
ATTR_FALLTHROUGH;
case WHEELUPMOUSE:
- case UPARROWKEY:
+ case EVT_UPARROWKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_DOCUMENT) {
if (doc_scroll > 0) {
@@ -559,8 +559,8 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
}
}
break;
- case RIGHTSHIFTKEY:
- case LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
break;
#if 0
default:
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 68d5765e43d..9ae9811c626 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1713,7 +1713,7 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
/* items for modal map */
WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM);
- WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, VIEW_MODAL_CONFIRM);
+ WM_modalkeymap_add_item(keymap, EVT_ESCKEY, KM_PRESS, KM_ANY, 0, VIEW_MODAL_CONFIRM);
/* disabled mode switching for now, can re-implement better, later on */
#if 0
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index d8700a3dba4..260748ce953 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -788,21 +788,21 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
/* Initialize */
switch (key_type) {
- case XKEY:
+ case EVT_XKEY:
msg1 = TIP_("along X");
msg2 = TIP_("along %s X");
msg3 = TIP_("locking %s X");
axis = 'X';
constraint_axis = CON_AXIS0;
break;
- case YKEY:
+ case EVT_YKEY:
msg1 = TIP_("along Y");
msg2 = TIP_("along %s Y");
msg3 = TIP_("locking %s Y");
axis = 'Y';
constraint_axis = CON_AXIS1;
break;
- case ZKEY:
+ case EVT_ZKEY:
msg1 = TIP_("along Z");
msg2 = TIP_("along %s Z");
msg3 = TIP_("locking %s Z");
@@ -815,7 +815,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm
}
constraint_plane = ((CON_AXIS0 | CON_AXIS1 | CON_AXIS2) & (~constraint_axis));
- if (edit_2d && (key_type != ZKEY)) {
+ if (edit_2d && (key_type != EVT_ZKEY)) {
if (cmode == axis) {
stopConstraint(t);
}
@@ -1047,42 +1047,42 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
case TFM_MODAL_AXIS_X:
if (!(t->flag & T_NO_CONSTRAINT)) {
- transform_event_xyz_constraint(t, XKEY, cmode, false);
+ transform_event_xyz_constraint(t, EVT_XKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Y:
if ((t->flag & T_NO_CONSTRAINT) == 0) {
- transform_event_xyz_constraint(t, YKEY, cmode, false);
+ transform_event_xyz_constraint(t, EVT_YKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_AXIS_Z:
if ((t->flag & (T_NO_CONSTRAINT)) == 0) {
- transform_event_xyz_constraint(t, ZKEY, cmode, false);
+ transform_event_xyz_constraint(t, EVT_ZKEY, cmode, false);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_X:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- transform_event_xyz_constraint(t, XKEY, cmode, true);
+ transform_event_xyz_constraint(t, EVT_XKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_Y:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- transform_event_xyz_constraint(t, YKEY, cmode, true);
+ transform_event_xyz_constraint(t, EVT_YKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
case TFM_MODAL_PLANE_Z:
if ((t->flag & (T_NO_CONSTRAINT | T_2D_EDIT)) == 0) {
- transform_event_xyz_constraint(t, ZKEY, cmode, true);
+ transform_event_xyz_constraint(t, EVT_ZKEY, cmode, true);
t->redraw |= TREDRAW_HARD;
handled = true;
}
@@ -1187,15 +1187,15 @@ int transformEvent(TransInfo *t, const wmEvent *event)
/* else do non-mapped events */
else if (event->val == KM_PRESS) {
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
t->state = TRANS_CANCEL;
handled = true;
break;
- case SPACEKEY:
- case PADENTER:
- case RETKEY:
+ case EVT_SPACEKEY:
+ case EVT_PADENTER:
+ case EVT_RETKEY:
if (event->is_repeat) {
break;
}
@@ -1204,8 +1204,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
break;
/* enforce redraw of transform when modifiers are used */
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
t->modifiers |= MOD_CONSTRAINT_PLANE;
t->redraw |= TREDRAW_HARD;
handled = true;
@@ -1246,7 +1246,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case GKEY:
+ case EVT_GKEY:
if (event->is_repeat) {
break;
}
@@ -1261,7 +1261,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case SKEY:
+ case EVT_SKEY:
if (event->is_repeat) {
break;
}
@@ -1276,7 +1276,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case RKEY:
+ case EVT_RKEY:
if (event->is_repeat) {
break;
}
@@ -1299,7 +1299,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
}
}
break;
- case CKEY:
+ case EVT_CKEY:
if (event->is_repeat) {
break;
}
@@ -1313,7 +1313,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
}
}
break;
- case OKEY:
+ case EVT_OKEY:
if (event->is_repeat) {
break;
}
@@ -1324,7 +1324,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
if (event->alt && t->flag & T_PROP_EDIT) {
t->prop_size *= (t->modifiers & MOD_PRECISION) ? 1.01f : 1.1f;
if (t->spacetype == SPACE_VIEW3D && t->persp != RV3D_ORTHO) {
@@ -1335,7 +1335,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case PAGEUPKEY:
+ case EVT_PAGEUPKEY:
case WHEELDOWNMOUSE:
if (t->flag & T_AUTOIK) {
transform_autoik_update(t, 1);
@@ -1346,7 +1346,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
t->redraw = TREDRAW_HARD;
handled = true;
break;
- case PADMINUS:
+ case EVT_PADMINUS:
if (event->alt && t->flag & T_PROP_EDIT) {
t->prop_size /= (t->modifiers & MOD_PRECISION) ? 1.01f : 1.1f;
calculatePropRatio(t);
@@ -1354,7 +1354,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case PAGEDOWNKEY:
+ case EVT_PAGEDOWNKEY:
case WHEELUPMOUSE:
if (t->flag & T_AUTOIK) {
transform_autoik_update(t, -1);
@@ -1365,15 +1365,15 @@ int transformEvent(TransInfo *t, const wmEvent *event)
t->redraw = TREDRAW_HARD;
handled = true;
break;
- case LEFTALTKEY:
- case RIGHTALTKEY:
+ case EVT_LEFTALTKEY:
+ case EVT_RIGHTALTKEY:
if (ELEM(t->spacetype, SPACE_SEQ, SPACE_VIEW3D)) {
t->flag |= T_ALT_TRANSFORM;
t->redraw |= TREDRAW_HARD;
handled = true;
}
break;
- case NKEY:
+ case EVT_NKEY:
if (event->is_repeat) {
break;
}
@@ -1397,8 +1397,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
}
else if (event->val == KM_RELEASE) {
switch (event->type) {
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
t->modifiers &= ~MOD_CONSTRAINT_PLANE;
t->redraw |= TREDRAW_HARD;
handled = true;
@@ -1412,8 +1412,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
handled = true;
}
break;
- case LEFTALTKEY:
- case RIGHTALTKEY:
+ case EVT_LEFTALTKEY:
+ case EVT_RIGHTALTKEY:
if (ELEM(t->spacetype, SPACE_SEQ, SPACE_VIEW3D)) {
t->flag &= ~T_ALT_TRANSFORM;
t->redraw |= TREDRAW_HARD;
@@ -2060,10 +2060,10 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
}
if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS) {
- if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) && event->ctrl) ||
- (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
- (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) && event->alt) ||
- ((kmi->type == OSKEY) && event->oskey)) {
+ if ((ELEM(kmi->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY) && event->ctrl) ||
+ (ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) && event->shift) ||
+ (ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && event->alt) ||
+ ((kmi->type == EVT_OSKEY) && event->oskey)) {
t->modifiers |= MOD_SNAP_INVERT;
}
break;
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index fb929b60739..fc71457171d 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -476,8 +476,8 @@ eRedrawFlag handleMouseInput(TransInfo *t, MouseInput *mi, const wmEvent *event)
eRedrawFlag redraw = TREDRAW_NOTHING;
switch (event->type) {
- case LEFTSHIFTKEY:
- case RIGHTSHIFTKEY:
+ case EVT_LEFTSHIFTKEY:
+ case EVT_RIGHTSHIFTKEY:
if (event->val == KM_PRESS) {
t->modifiers |= MOD_PRECISION;
/* shift is modifier for higher precision transforn */
diff --git a/source/blender/editors/transform/transform_mode_edge_slide.c b/source/blender/editors/transform/transform_mode_edge_slide.c
index fb43d75567c..a012d89d107 100644
--- a/source/blender/editors/transform/transform_mode_edge_slide.c
+++ b/source/blender/editors/transform/transform_mode_edge_slide.c
@@ -1098,21 +1098,21 @@ static eRedrawFlag handleEventEdgeSlide(struct TransInfo *t, const struct wmEven
if (slp) {
switch (event->type) {
- case EKEY:
+ case EVT_EKEY:
if (event->val == KM_PRESS) {
slp->use_even = !slp->use_even;
calcEdgeSlideCustomPoints(t);
return TREDRAW_HARD;
}
break;
- case FKEY:
+ case EVT_FKEY:
if (event->val == KM_PRESS) {
slp->flipped = !slp->flipped;
calcEdgeSlideCustomPoints(t);
return TREDRAW_HARD;
}
break;
- case CKEY:
+ case EVT_CKEY:
/* use like a modifier key */
if (event->val == KM_PRESS) {
t->flag ^= T_ALT_TRANSFORM;
diff --git a/source/blender/editors/transform/transform_mode_shear.c b/source/blender/editors/transform/transform_mode_shear.c
index f57ae11d121..c3313046a11 100644
--- a/source/blender/editors/transform/transform_mode_shear.c
+++ b/source/blender/editors/transform/transform_mode_shear.c
@@ -101,13 +101,13 @@ static eRedrawFlag handleEventShear(TransInfo *t, const wmEvent *event)
status = TREDRAW_HARD;
}
- else if (event->type == XKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_XKEY && event->val == KM_PRESS) {
t->orient_axis_ortho = (t->orient_axis + 1) % 3;
initShear_mouseInputMode(t);
status = TREDRAW_HARD;
}
- else if (event->type == YKEY && event->val == KM_PRESS) {
+ else if (event->type == EVT_YKEY && event->val == KM_PRESS) {
t->orient_axis_ortho = (t->orient_axis + 2) % 3;
initShear_mouseInputMode(t);
diff --git a/source/blender/editors/transform/transform_mode_vert_slide.c b/source/blender/editors/transform/transform_mode_vert_slide.c
index ae775b5db24..15f999d37ec 100644
--- a/source/blender/editors/transform/transform_mode_vert_slide.c
+++ b/source/blender/editors/transform/transform_mode_vert_slide.c
@@ -328,7 +328,7 @@ static eRedrawFlag handleEventVertSlide(struct TransInfo *t, const struct wmEven
if (slp) {
switch (event->type) {
- case EKEY:
+ case EVT_EKEY:
if (event->val == KM_PRESS) {
slp->use_even = !slp->use_even;
if (slp->flipped) {
@@ -337,14 +337,14 @@ static eRedrawFlag handleEventVertSlide(struct TransInfo *t, const struct wmEven
return TREDRAW_HARD;
}
break;
- case FKEY:
+ case EVT_FKEY:
if (event->val == KM_PRESS) {
slp->flipped = !slp->flipped;
calcVertSlideCustomPoints(t);
return TREDRAW_HARD;
}
break;
- case CKEY:
+ case EVT_CKEY:
/* use like a modifier key */
if (event->val == KM_PRESS) {
t->flag ^= T_ALT_TRANSFORM;
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index ead841642d7..88b1bbe3f4b 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -354,7 +354,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
ascii[0] = event->ascii;
}
break;
- case BACKSPACEKEY:
+ case EVT_BACKSPACEKEY:
/* Part specific to backspace... */
if (!(n->val_flag[idx] & NUM_EDITED)) {
copy_v3_v3(n->val, n->val_org);
@@ -381,7 +381,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
* only difference is remove char(s) before/after the cursor. */
dir = STRCUR_DIR_PREV;
ATTR_FALLTHROUGH;
- case DELKEY:
+ case EVT_DELKEY:
if ((n->val_flag[idx] & NUM_EDITED) && n->str[0]) {
int t_cur = cur = n->str_cur;
if (event->ctrl) {
@@ -405,10 +405,10 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
return false;
}
break;
- case LEFTARROWKEY:
+ case EVT_LEFTARROWKEY:
dir = STRCUR_DIR_PREV;
ATTR_FALLTHROUGH;
- case RIGHTARROWKEY:
+ case EVT_RIGHTARROWKEY:
cur = n->str_cur;
if (event->ctrl) {
mode = STRCUR_JUMP_DELIM;
@@ -419,19 +419,19 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
return true;
}
return false;
- case HOMEKEY:
+ case EVT_HOMEKEY:
if (n->str[0]) {
n->str_cur = 0;
return true;
}
return false;
- case ENDKEY:
+ case EVT_ENDKEY:
if (n->str[0]) {
n->str_cur = strlen(n->str);
return true;
}
return false;
- case TABKEY:
+ case EVT_TABKEY:
#ifdef USE_FAKE_EDIT
n->val_flag[idx] &= ~(NUM_NEGATE | NUM_INVERSE);
#endif
@@ -446,8 +446,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
n->str_cur = 0;
}
return true;
- case PADPERIOD:
- case PERIODKEY:
+ case EVT_PADPERIOD:
+ case EVT_PERIODKEY:
/* Force numdot, some OSs/countries generate a comma char in this case,
* sic... (T37992) */
ascii[0] = '.';
@@ -473,29 +473,29 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
#endif
#ifdef USE_FAKE_EDIT
- case PADMINUS:
- case MINUSKEY:
+ case EVT_PADMINUS:
+ case EVT_MINUSKEY:
if (event->ctrl || !(n->flag & NUM_EDIT_FULL)) {
n->val_flag[idx] ^= NUM_NEGATE;
updated = true;
}
break;
- case PADSLASHKEY:
- case SLASHKEY:
+ case EVT_PADSLASHKEY:
+ case EVT_SLASHKEY:
if (event->ctrl || !(n->flag & NUM_EDIT_FULL)) {
n->val_flag[idx] ^= NUM_INVERSE;
updated = true;
}
break;
#endif
- case CKEY:
+ case EVT_CKEY:
if (event->ctrl) {
/* Copy current str to the copypaste buffer. */
WM_clipboard_text_set(n->str, 0);
updated = true;
}
break;
- case VKEY:
+ case EVT_VKEY:
if (event->ctrl) {
/* extract the first line from the clipboard */
int pbuf_len;
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 5544c5cee63..d6652aca216 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -2608,13 +2608,13 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_PASS_THROUGH;
/* Cancel */
- case ESCKEY:
+ case EVT_ESCKEY:
stitch_cancel(C, op);
return OPERATOR_CANCELLED;
case LEFTMOUSE:
- case PADENTER:
- case RETKEY:
+ case EVT_PADENTER:
+ case EVT_RETKEY:
if (event->val == KM_PRESS) {
if (stitch_process_data(ssc, active_state, scene, true)) {
stitch_exit(C, op, 1);
@@ -2629,7 +2629,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
/* Increase limit */
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
case WHEELUPMOUSE:
if (event->val == KM_PRESS && event->alt) {
ssc->limit_dist += 0.01f;
@@ -2643,7 +2643,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
/* Decrease limit */
- case PADMINUS:
+ case EVT_PADMINUS:
case WHEELDOWNMOUSE:
if (event->val == KM_PRESS && event->alt) {
ssc->limit_dist -= 0.01f;
@@ -2659,7 +2659,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* Use Limit (Default off) */
- case LKEY:
+ case EVT_LKEY:
if (event->val == KM_PRESS) {
ssc->use_limit = !ssc->use_limit;
if (!stitch_process_data(ssc, active_state, scene, false)) {
@@ -2670,7 +2670,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
return OPERATOR_RUNNING_MODAL;
- case IKEY:
+ case EVT_IKEY:
if (event->val == KM_PRESS) {
/* Move to next island and maybe next object */
@@ -2694,7 +2694,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
return OPERATOR_RUNNING_MODAL;
- case MKEY:
+ case EVT_MKEY:
if (event->val == KM_PRESS) {
ssc->midpoints = !ssc->midpoints;
if (!stitch_process_data(ssc, active_state, scene, false)) {
@@ -2722,7 +2722,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_RUNNING_MODAL;
/* snap islands on/off */
- case SKEY:
+ case EVT_SKEY:
if (event->val == KM_PRESS) {
ssc->snap_islands = !ssc->snap_islands;
if (!stitch_process_data(ssc, active_state, scene, false)) {
@@ -2736,7 +2736,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* switch between edge/vertex mode */
- case TABKEY:
+ case EVT_TABKEY:
if (event->val == KM_PRESS) {
stitch_switch_selection_mode_all(ssc);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index a198ebb6f20..7f42eeb5dd7 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -811,16 +811,16 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
MinStretch *ms = op->customdata;
switch (event->type) {
- case ESCKEY:
+ case EVT_ESCKEY:
case RIGHTMOUSE:
minimize_stretch_exit(C, op, true);
return OPERATOR_CANCELLED;
- case RETKEY:
- case PADENTER:
+ case EVT_RETKEY:
+ case EVT_PADENTER:
case LEFTMOUSE:
minimize_stretch_exit(C, op, false);
return OPERATOR_FINISHED;
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
case WHEELUPMOUSE:
if (event->val == KM_PRESS) {
if (ms->blend < 0.95f) {
@@ -831,7 +831,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
}
}
break;
- case PADMINUS:
+ case EVT_PADMINUS:
case WHEELDOWNMOUSE:
if (event->val == KM_PRESS) {
if (ms->blend > 0.05f) {