Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-02-25 19:32:03 +0300
committerTon Roosendaal <ton@blender.org>2011-02-25 19:32:03 +0300
commitd6f69a2c194b3b35f52c8e691c7d9b7625a727f8 (patch)
tree8cbb1158d625110cd8ab397dc61ddfeace63b061 /source/blender/windowmanager/intern/wm_keymap.c
parentbc15e0e2952bac0458ae61c97d4d8187e55cd1cc (diff)
Bugfix #26174
Shift+A "add primitive" menu didn't allow to set shortcuts on the sublevels.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c16
1 files changed, 16 insertions, 0 deletions
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);