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:
authorCampbell Barton <ideasman42@gmail.com>2019-01-07 03:00:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-07 03:00:46 +0300
commit430cf7e15eef9b5f2aa7216f298b482a3163b02b (patch)
tree9bd6b0e5cefa9180923b135d2b53dfa783c739a0 /release
parent8c0a77b8949f05f97f350ff496a0113b8d0e2af7 (diff)
Fix generated toolbar keymap w/ annotation tool
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py19
1 files changed, 13 insertions, 6 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 ba768426017..c49056117bf 100644
--- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
+++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
@@ -230,12 +230,19 @@ def generate(context, space_type):
kmi_first = km.keymap_items
kmi_first = kmi_first[0] if kmi_first else None
if kmi_first is not None:
- kmi_found = wm.keyconfigs.find_item_from_operator(
- idname=kmi_first.idname,
- # properties=kmi_first.properties, # prevents matches, don't use.
- context='INVOKE_REGION_WIN',
- include={'KEYBOARD'},
- )[1]
+ # We need 'MOUSE' so keys with 'key_modifier' are found.
+ for kmi_type in ('KEYBOARD', 'MOUSE'):
+ kmi_found = wm.keyconfigs.find_item_from_operator(
+ idname=kmi_first.idname,
+ # properties=kmi_first.properties, # prevents matches, don't use.
+ context='INVOKE_REGION_WIN',
+ include={kmi_type},
+ )[1]
+ if kmi_found is not None:
+ if (kmi_type == 'MOUSE') and (kmi_found.key_modifier == 'NONE'):
+ kmi_found = None
+ if kmi_found is not None:
+ break
else:
kmi_found = None
del kmi_first