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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-11 17:38:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-11 17:40:23 +0400
commit50650e28ea5641b200727fcbe14de83fa10e2c49 (patch)
tree8ae157905baa7f0677d90b467ec8a9fb9c746076 /source
parent1a0c5eb83aaaf18cef25d6d36a2c857c1381516c (diff)
Events: support for buttons 6 & 7 (some trackballs have these) X11 only
Patch by Marcus von Appen Note: this patch makes ISMOUSE accept INBETWEEN_MOUSEMOVE as a mouse event where before it didnt.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
-rw-r--r--source/blender/windowmanager/wm_event_types.h5
3 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 0eda2662e43..f4f2f834398 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -81,6 +81,8 @@ static EnumPropertyItem event_mouse_type_items[] = {
{RIGHTMOUSE, "RIGHTMOUSE", 0, "Right", ""},
{BUTTON4MOUSE, "BUTTON4MOUSE", 0, "Button4", ""},
{BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5", ""},
+ {BUTTON6MOUSE, "BUTTON6MOUSE", 0, "Button6", ""},
+ {BUTTON7MOUSE, "BUTTON7MOUSE", 0, "Button7", ""},
{ACTIONMOUSE, "ACTIONMOUSE", 0, "Action", ""},
{SELECTMOUSE, "SELECTMOUSE", 0, "Select", ""},
{0, "", 0, NULL, NULL},
@@ -173,6 +175,8 @@ EnumPropertyItem event_type_items[] = {
{RIGHTMOUSE, "RIGHTMOUSE", 0, "Right Mouse", ""},
{BUTTON4MOUSE, "BUTTON4MOUSE", 0, "Button4 Mouse", ""},
{BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5 Mouse", ""},
+ {BUTTON6MOUSE, "BUTTON6MOUSE", 0, "Button6 Mouse", ""},
+ {BUTTON7MOUSE, "BUTTON7MOUSE", 0, "Button7 Mouse", ""},
{ACTIONMOUSE, "ACTIONMOUSE", 0, "Action Mouse", ""},
{SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", ""},
{0, "", 0, NULL, NULL},
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ef9b7c4f1b0..e4dfae284fe 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3011,6 +3011,10 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type = BUTTON4MOUSE;
else if (bd->button == GHOST_kButtonMaskButton5)
event.type = BUTTON5MOUSE;
+ else if (bd->button == GHOST_kButtonMaskButton6)
+ event.type = BUTTON6MOUSE;
+ else if (bd->button == GHOST_kButtonMaskButton7)
+ event.type = BUTTON7MOUSE;
else
event.type = MIDDLEMOUSE;
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index df3096eed07..08cbd535262 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -65,6 +65,9 @@
/* Extra mouse buttons */
#define BUTTON4MOUSE 7
#define BUTTON5MOUSE 8
+ /* More mouse buttons - can't use 9 and 10 here (wheel) */
+#define BUTTON6MOUSE 18
+#define BUTTON7MOUSE 19
/* Extra trackpad gestures */
#define MOUSEPAN 14
#define MOUSEZOOM 15
@@ -297,7 +300,7 @@ enum {
#define ISKEYMODIFIER(event_type) ((event_type >= LEFTCTRLKEY && event_type <= LEFTSHIFTKEY) || event_type == OSKEY)
/* test whether the event is a mouse button */
-#define ISMOUSE(event_type) (event_type >= LEFTMOUSE && event_type <= MOUSEROTATE)
+#define ISMOUSE(event_type) (event_type >= LEFTMOUSE && event_type <= BUTTON7MOUSE)
/* test whether the event is tweak event */
#define ISTWEAK(event_type) (event_type >= EVT_TWEAK_L && event_type <= EVT_GESTURE)