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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-18 20:11:53 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-18 20:11:53 +0400
commitb51ebdf0bafd5f9baed88673fb58d947aba426b3 (patch)
treefcd92a4f8da7d426c281474cc58748612e4d8860 /source/blender/windowmanager
parent14d33b3c1fd629ca3ebc2f369b38d9d2ebc09e2e (diff)
2.5: Middle mouse button emulation with alt + left mouse button
works again, implemented at windowmanager level this time.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 737028843d3..f0d9f8c0989 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -672,7 +672,19 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
int kmitype= wm_userdef_event_map(kmi->type);
if(kmi->inactive) return 0;
-
+
+ /* exception for middlemouse emulation */
+ if((U.flag & USER_TWOBUTTONMOUSE) && (kmi->type == MIDDLEMOUSE)) {
+ if(winevent->type == LEFTMOUSE && winevent->alt) {
+ wmKeymapItem tmp= *kmi;
+
+ tmp.type= winevent->type;
+ tmp.alt= winevent->alt;
+ if(wm_eventmatch(winevent, &tmp))
+ return 1;
+ }
+ }
+
/* the matching rules */
if(kmitype==KM_TEXTINPUT)
if(ISKEYBOARD(winevent->type)) return 1;