Keymaps: fix keymap items created in python being added with the python
operator names instead of the internal names. This wasn't really noticeable, expect that it broke automatically looking up shortcuts for display in menus.
This commit is contained in:
@@ -1048,6 +1048,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr)
|
||||
static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
|
||||
{
|
||||
// wmWindowManager *wm = CTX_wm_manager(C);
|
||||
char idname_bl[OP_MAX_TYPENAME];
|
||||
int modifier= 0;
|
||||
|
||||
/* only on non-modal maps */
|
||||
@@ -1056,6 +1057,8 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WM_operator_bl_idname(idname_bl, idname);
|
||||
|
||||
if(shift) modifier |= KM_SHIFT;
|
||||
if(ctrl) modifier |= KM_CTRL;
|
||||
if(alt) modifier |= KM_ALT;
|
||||
@@ -1063,7 +1066,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
|
||||
|
||||
if(any) modifier = KM_ANY;
|
||||
|
||||
return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier);
|
||||
return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier);
|
||||
}
|
||||
|
||||
static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
|
||||
|
Reference in New Issue
Block a user