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@gmail.com>2018-11-12 16:53:08 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-13 20:22:07 +0300
commit7aae28af2d7dd9d593c4208d8c73d06d9e274044 (patch)
treeeee275d3771c0c941f2c08576493f6406fee2a22 /source/blender/windowmanager/intern/wm.c
parentfe4df40f3086d7fc135e17a15e0c4060f6b66dae (diff)
Keymaps: refactor loading of default keymap, fix bugs.
This refactors loading of key configurations to clear and refill existing ones, rather than adding a new one and then removing the old one. This fixes broken loading of non-default configurations after recent changes, and prepares for future changes to make it possible to dynamically change key configurations based on user preferences.
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r--source/blender/windowmanager/intern/wm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index cf7c43ff5c0..bc9c1e263cb 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -231,11 +231,11 @@ void WM_keymap_init(bContext *C)
/* create standard key configs */
if (!wm->defaultconf)
- wm->defaultconf = WM_keyconfig_new(wm, "Blender");
+ wm->defaultconf = WM_keyconfig_new(wm, "Blender", false);
if (!wm->addonconf)
- wm->addonconf = WM_keyconfig_new(wm, "Blender Addon");
+ wm->addonconf = WM_keyconfig_new(wm, "Blender Addon", false);
if (!wm->userconf)
- wm->userconf = WM_keyconfig_new(wm, "Blender User");
+ wm->userconf = WM_keyconfig_new(wm, "Blender User", false);
/* initialize only after python init is done, for keymaps that
* use python operators */
@@ -246,6 +246,10 @@ void WM_keymap_init(bContext *C)
wm_window_keymap(wm->defaultconf);
ED_spacetypes_keymap(wm->defaultconf);
+ BPY_execute_string(
+ C, (const char *[]){"bpy", NULL},
+ "bpy.utils.keyconfig_init()");
+
wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
}