[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40043] trunk/blender/source/blender/ windowmanager/intern/wm_keymap.c: Fix #28310: import of key configuration with modal keymap not working.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Sep 8 15:22:26 CEST 2011


Revision: 40043
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40043
Author:   blendix
Date:     2011-09-08 13:22:26 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
Fix #28310: import of key configuration with modal keymap not working.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_keymap.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_keymap.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_keymap.c	2011-09-08 12:53:01 UTC (rev 40042)
+++ trunk/blender/source/blender/windowmanager/intern/wm_keymap.c	2011-09-08 13:22:26 UTC (rev 40043)
@@ -47,6 +47,7 @@
 #include "BKE_blender.h"
 #include "BKE_context.h"
 #include "BKE_idprop.h"
+#include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_screen.h"
@@ -680,6 +681,17 @@
 	wmKeyMap *km= WM_keymap_find(keyconf, idname, 0, 0);
 	km->flag |= KEYMAP_MODAL;
 	km->modal_items= items;
+
+	if(!items) {
+		/* init modal items from default config */
+		wmWindowManager *wm = G.main->wm.first;
+		wmKeyMap *defaultkm= WM_keymap_list_find(&wm->defaultconf->keymaps, km->idname, 0, 0);
+
+		if(defaultkm) {
+			km->modal_items = defaultkm->modal_items;
+			km->poll = defaultkm->poll;
+		}
+	}
 	
 	return km;
 }




More information about the Bf-blender-cvs mailing list