[Bf-blender-cvs] [e584809e556] soc-2021-curves: Updated wmEvent->modifier usage
Dilith Jayakody
noreply at git.blender.org
Sat Mar 5 16:40:03 CET 2022
Commit: e584809e5564d06fd28dca5a4badb758e323f93d
Author: Dilith Jayakody
Date: Fri Feb 25 14:14:58 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rBe584809e5564d06fd28dca5a4badb758e323f93d
Updated wmEvent->modifier usage
===================================================================
M source/blender/editors/curve/editcurve_pen.c
===================================================================
diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c
index 310aa54f1a3..fd3f69cdc16 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -1145,12 +1145,12 @@ static bool is_spline_nearby(ViewContext *vc,
static bool is_extra_key_pressed(const wmEvent *event, int key)
{
- return (key == SHIFT && event->shift && !event->ctrl && !event->alt) ||
- (key == CTRL && !event->shift && event->ctrl && !event->alt) ||
- (key == ALT && !event->shift && !event->ctrl && event->alt) ||
- (key == CTRL_SHIFT && event->shift && event->ctrl && !event->alt) ||
- (key == CTRL_ALT && !event->shift && event->ctrl && event->alt) ||
- (key == SHIFT_ALT && event->shift && !event->ctrl && event->alt);
+ const bool shift = event->modifier == KM_SHIFT;
+ const bool ctrl = event->modifier == KM_CTRL;
+ const bool alt = event->modifier == KM_ALT;
+ return (key == SHIFT && shift && !ctrl && !alt) || (key == CTRL && !shift && ctrl && !alt) ||
+ (key == ALT && !shift && !ctrl && alt) || (key == CTRL_SHIFT && shift && ctrl && !alt) ||
+ (key == CTRL_ALT && !shift && ctrl && alt) || (key == SHIFT_ALT && shift && !ctrl && alt);
}
/* Move segment to mouse pointer. */
More information about the Bf-blender-cvs
mailing list