diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-14 10:59:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-14 10:59:26 +0300 |
commit | a6b2ec0bc2315103717a75e7f0f3b3ccfad1ce63 (patch) | |
tree | 5edaeb60d1f42eb847cd52c8853837d6d6079663 /release/scripts/modules/bl_keymap_utils | |
parent | 2e3e94c7962fb02e8081489886a2c1efa545e860 (diff) |
Fix toolbar accelerator w/ user defined keyconfig
Diffstat (limited to 'release/scripts/modules/bl_keymap_utils')
-rw-r--r-- | release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py index a1a65a44750..0d2b6fb0a17 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -88,14 +88,16 @@ def generate(context, space_type): km_name_default = "Toolbar Popup" km_name = km_name_default + " <temp>" wm = context.window_manager - keyconf = wm.keyconfigs.active - keymap = keyconf.keymaps.get(km_name) + keyconf_user = wm.keyconfigs.user + keyconf_active = wm.keyconfigs.active + + keymap = keyconf_active.keymaps.get(km_name) if keymap is None: - keymap = keyconf.keymaps.new(km_name, space_type='EMPTY', region_type='TEMPORARY') + keymap = keyconf_active.keymaps.new(km_name, space_type='EMPTY', region_type='TEMPORARY') for kmi in keymap.keymap_items: keymap.keymap_items.remove(kmi) - keymap_src = keyconf.keymaps.get(km_name_default) + keymap_src = keyconf_user.keymaps.get(km_name_default) if keymap_src is not None: for kmi_src in keymap_src.keymap_items: # Skip tools that aren't currently shown. @@ -222,7 +224,7 @@ def generate(context, space_type): include={'KEYBOARD'}, )[1] elif item.keymap is not None: - km = keyconf.keymaps.get(item.keymap[0]) + km = keyconf_user.keymaps.get(item.keymap[0]) if km is None: print("Keymap", repr(item.keymap[0]), "not found for tool", item.text) kmi_found = None |