forked from bartvdbraak/blender
This commit is contained in:
parent
081543fee8
commit
e276855e60
@ -295,6 +295,7 @@ typedef struct wmKeyConfig {
|
||||
|
||||
/* wmKeyConfig.flag */
|
||||
#define KEYCONF_USER (1 << 1)
|
||||
#define KEYCONF_INIT_DEFAULT (1 << 2)
|
||||
|
||||
/* this one is the operator itself, stored in files for macros etc */
|
||||
/* operator + operatortype should be able to redo entirely, but for different contextes */
|
||||
|
@ -230,6 +230,7 @@ void WM_keymap_init(bContext *C)
|
||||
{
|
||||
wmWindowManager *wm= CTX_wm_manager(C);
|
||||
|
||||
/* create standard key configs */
|
||||
if(!wm->defaultconf)
|
||||
wm->defaultconf= WM_keyconfig_new(wm, "Blender");
|
||||
if(!wm->addonconf)
|
||||
@ -237,10 +238,17 @@ void WM_keymap_init(bContext *C)
|
||||
if(!wm->userconf)
|
||||
wm->userconf= WM_keyconfig_new(wm, "Blender User");
|
||||
|
||||
/* initialize only after python init is done, for keymaps that
|
||||
use python operators */
|
||||
if(CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) {
|
||||
/* create default key config */
|
||||
wm_window_keymap(wm->defaultconf);
|
||||
ED_spacetypes_keymap(wm->defaultconf);
|
||||
/* create default key config, only initialize once,
|
||||
it's persistent across sessions */
|
||||
if(!(wm->defaultconf->flag & KEYCONF_INIT_DEFAULT)) {
|
||||
wm_window_keymap(wm->defaultconf);
|
||||
ED_spacetypes_keymap(wm->defaultconf);
|
||||
|
||||
wm->defaultconf->flag |= KEYCONF_INIT_DEFAULT;
|
||||
}
|
||||
|
||||
WM_keyconfig_update_tag(NULL, NULL);
|
||||
WM_keyconfig_update(wm);
|
||||
|
Loading…
Reference in New Issue
Block a user