[Bf-blender-cvs] [92653fe] master: Keymap search: check 'key_modifier' as well as 'type'

Campbell Barton noreply at git.blender.org
Tue Feb 25 14:39:54 CET 2014


Commit: 92653fe9449a40ceb14466b8bf1ced4982e0945c
Author: Campbell Barton
Date:   Wed Feb 26 00:13:20 2014 +1100
https://developer.blender.org/rB92653fe9449a40ceb14466b8bf1ced4982e0945c

Keymap search: check 'key_modifier' as well as 'type'

===================================================================

M	release/scripts/modules/rna_keymap_ui.py

===================================================================

diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py
index 64b6243..e6112cb 100644
--- a/release/scripts/modules/rna_keymap_ui.py
+++ b/release/scripts/modules/rna_keymap_ui.py
@@ -297,7 +297,15 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
         # main filter func, runs many times
         def filter_func(kmi):
             for kk, ki in kmi_test_dict.items():
-                if getattr(kmi, kk) not in ki:
+                val = getattr(kmi, kk)
+                if val == 'NONE' or val not in ki:
+                    # exception for 'type'
+                    # also inspect 'key_modifier' as a fallback
+                    if kk == "type":
+                        val = getattr(kmi, "key_modifier")
+                        if not (val == 'NONE' or val not in ki):
+                            continue
+
                     return False
             return True




More information about the Bf-blender-cvs mailing list