Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2018 10:11:16 +0000 (12:11 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2018 10:11:16 +0000 (12:11 +0200)
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/wm_event_types.h

index 1e3a08bdcbc0e33a5af51ec51d9690ea28c88c44..ffef33d344ab9db9131aefe221f95901da17bd23 100644 (file)
@@ -2549,7 +2549,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
                        }
                }
        }
-       else if (ISMOUSE(event->type) || ISKEYBOARD(event->type)) {
+       else if (ISMOUSE_BUTTON(event->type) || ISKEYBOARD(event->type)) {
                /* All events that don't set wmEvent.prevtype must be ignored. */
 
                /* test for CLICK events */
index db2fd5ce7f29ec290f4d04c48280d53f5c21e2af..be64862807942bfada62508713edf40e154ac0c8 100644 (file)
@@ -368,6 +368,13 @@ enum {
 /* test whether the event is a mouse button */
 #define ISMOUSE(event_type)  ((event_type) >= LEFTMOUSE && (event_type) <= BUTTON7MOUSE)
 
+#define ISMOUSE_WHEEL(event_type)  ((event_type) >= WHEELUPMOUSE && (event_type) <= WHEELOUTMOUSE)
+#define ISMOUSE_GESTURE(event_type)  ((event_type) >= MOUSEPAN && (event_type) <= MOUSEROTATE)
+#define ISMOUSE_BUTTON(event_type) \
+       (ELEM(event_type, \
+             LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE, ACTIONMOUSE, SELECTMOUSE, \
+             BUTTON4MOUSE, BUTTON5MOUSE, BUTTON6MOUSE, BUTTON7MOUSE))
+
 /* test whether the event is tweak event */
 #define ISTWEAK(event_type)  ((event_type) >= EVT_TWEAK_L && (event_type) <= EVT_GESTURE)