WM: prefer define over zero wmEvent.val

This commit is contained in:
Campbell Barton
2015-04-05 06:22:49 +10:00
parent 8eac4085be
commit cedd7cde44
4 changed files with 6 additions and 6 deletions

View File

@@ -1887,7 +1887,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
* (Disabling RIGHTMOUSE case here results in bugs like [#32647])
* also making sure we have a valid event value, to not exit too early
*/
if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && event->val != 0) {
if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && (event->val != KM_NOTHING)) {
/* if painting, end stroke */
if (p->status == GP_STATUS_PAINTING) {
int sketch = 0;

View File

@@ -717,7 +717,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type)
else
event.type = EVT_ACTIONZONE_REGION;
event.val = 0;
event.val = KM_NOTHING;
event.customdata = op->customdata;
event.customdatafree = true;
op->customdata = NULL;

View File

@@ -3116,7 +3116,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.x = evt->x = pd->x;
event.y = evt->y = pd->y;
event.val = 0;
event.val = KM_NOTHING;
/* Use prevx/prevy so we can calculate the delta later */
event.prevx = event.x - pd->deltaX;
@@ -3323,7 +3323,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type = TIMER;
event.custom = EVT_DATA_TIMER;
event.customdata = customdata;
event.val = 0;
event.val = KM_NOTHING;
event.keymodifier = 0;
wm_event_add(win, &event);
@@ -3333,7 +3333,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
case GHOST_kEventNDOFMotion:
{
event.type = NDOF_MOTION;
event.val = 0;
event.val = KM_NOTHING;
attach_ndof_data(&event, customdata);
wm_event_add(win, &event);

View File

@@ -1202,7 +1202,7 @@ static int wm_window_timer(const bContext *C)
wm_event_init_from_window(win, &event);
event.type = wt->event_type;
event.val = 0;
event.val = KM_NOTHING;
event.keymodifier = 0;
event.custom = EVT_DATA_TIMER;
event.customdata = wt;