diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-12-18 01:14:43 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-12-18 01:14:43 +0300 |
commit | 62639a55d90f1adc2e18f8d2b7d2556a761ef254 (patch) | |
tree | d1443e108af0755e9de81fcc98b7da7d26522394 /source/blender/makesrna | |
parent | 66c3ae5c34015265466a303776644bff18076379 (diff) |
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 11 |
3 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index f43db74286b..1c14d0d4c06 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -211,6 +211,7 @@ void RNA_api_operator(struct StructRNA *srna); void RNA_api_keyconfig(struct StructRNA *srna); void RNA_api_keyingset(struct StructRNA *srna); void RNA_api_keymap(struct StructRNA *srna); +void RNA_api_keymapitem(struct StructRNA *srna); void RNA_api_main(struct StructRNA *srna); void RNA_api_material(StructRNA *srna); void RNA_api_mesh(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 09adb642e58..3d4899a0a51 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -997,6 +997,8 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_INACTIVE); RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item."); RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1); + + RNA_api_keymapitem(srna); } void RNA_def_wm(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 94a689c9f1c..0cec66fe264 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -288,5 +288,16 @@ void RNA_api_keymap(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); } +void RNA_api_keymapitem(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *parm; + + func= RNA_def_function(srna, "compare", "WM_keymap_item_compare"); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_boolean(func, "result", 0, "Comparison result", ""); + RNA_def_function_return(func, parm); +} #endif |