diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index b6b96458208..57b84fc18f4 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -440,6 +440,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(const bContext *C, ListBase *h if(keymap && (!keymap->poll || keymap->poll((bContext*)C))) { for(kmi=keymap->items.first; kmi; kmi=kmi->next) { + if(strcmp(kmi->idname, opname) == 0 && WM_key_event_string(kmi->type)[0]) { if (hotkey) if (!ISHOTKEY(kmi->type)) @@ -803,9 +804,19 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) /* Editing Modes */ else if (strstr(opname, "MESH_OT")) { km = WM_keymap_find_all(C, "Mesh", 0, 0); + + /* some mesh operators are active in object mode too, like add-prim */ + if(km && km->poll && km->poll((bContext *)C)==0) { + km = WM_keymap_find_all(C, "Object Mode", 0, 0); + } } else if (strstr(opname, "CURVE_OT")) { km = WM_keymap_find_all(C, "Curve", 0, 0); + + /* some curve operators are active in object mode too, like add-prim */ + if(km && km->poll && km->poll((bContext *)C)==0) { + km = WM_keymap_find_all(C, "Object Mode", 0, 0); + } } else if (strstr(opname, "ARMATURE_OT")) { km = WM_keymap_find_all(C, "Armature", 0, 0); @@ -818,6 +829,11 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) } else if (strstr(opname, "MBALL_OT")) { km = WM_keymap_find_all(C, "Metaball", 0, 0); + + /* some mball operators are active in object mode too, like add-prim */ + if(km && km->poll && km->poll((bContext *)C)==0) { + km = WM_keymap_find_all(C, "Object Mode", 0, 0); + } } else if (strstr(opname, "LATTICE_OT")) { km = WM_keymap_find_all(C, "Lattice", 0, 0);