Fix toolbar key-accelerator w/ LMB select
authorCampbell Barton <ideasman42@gmail.com>
Tue, 11 Dec 2018 22:39:36 +0000 (09:39 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 11 Dec 2018 22:40:37 +0000 (09:40 +1100)
Tweak events were masking hotkey access.

Reported in T55162

release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py

index 501b15c3dc3aa33b9fdfe9ebc5d4e885db15ba7a..7f85faa4ba6bc547bfeefd747cfa1b17f13adc53 100644 (file)
@@ -129,7 +129,10 @@ def generate(context, space_type):
         kmi_hack_brush_select.active = False
 
     if use_release_confirm or use_tap_reset:
-        kmi_toolbar = wm.keyconfigs.find_item_from_operator(idname="wm.toolbar")[1]
+        kmi_toolbar = wm.keyconfigs.find_item_from_operator(
+            idname="wm.toolbar",
+            is_hotkey=True,
+        )[1]
         kmi_toolbar_type = None if not kmi_toolbar else kmi_toolbar.type
         if use_tap_reset and kmi_toolbar_type is not None:
             kmi_toolbar_args_type_only = {"type": kmi_toolbar_type}
@@ -148,6 +151,7 @@ def generate(context, space_type):
                 context='INVOKE_REGION_WIN',
                 # properties={"name": item.text},
                 properties=kmi_hack_properties,
+                is_hotkey=True,
             )[1]
             if kmi_found:
                 use_tap_reset = False
@@ -180,6 +184,7 @@ def generate(context, space_type):
                 context='INVOKE_REGION_WIN',
                 # properties={"name": item.text},
                 properties=kmi_hack_properties,
+                is_hotkey=True,
             )[1]
 
             if kmi_found is None:
@@ -200,6 +205,7 @@ def generate(context, space_type):
                             idname="paint.brush_select",
                             context='INVOKE_REGION_WIN',
                             properties=kmi_hack_brush_select_properties,
+                            is_hotkey=True,
                         )[1]
                     else:
                         print("Unsupported mode:", mode)
@@ -214,6 +220,7 @@ def generate(context, space_type):
             kmi_found = wm.keyconfigs.find_item_from_operator(
                 idname=item.operator,
                 context='INVOKE_REGION_WIN',
+                is_hotkey=True,
             )[1]
         elif item.keymap is not None:
             km = keyconf.keymaps.get(item.keymap[0])
@@ -228,6 +235,7 @@ def generate(context, space_type):
                         idname=kmi_first.idname,
                         # properties=kmi_first.properties,  # prevents matches, don't use.
                         context='INVOKE_REGION_WIN',
+                        is_hotkey=True,
                     )[1]
                 else:
                     kmi_found = None