Only add drivers (and keying sets, keyframes etc) when exact key combo is
authorMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 07:03:13 +0000 (07:03 +0000)
committerMatt Ebb <matt@mke3.net>
Wed, 31 Mar 2010 07:03:13 +0000 (07:03 +0000)
pressed. This prevent adding drivers to properties when mouse is over a node,
trying to duplicate it with Shift D.

source/blender/editors/interface/interface_handlers.c

index b9cb83b4ebb1c422d93da51e0dc34aa9f4a0b88d..2f14d23b518b6c92c65e76f54f1d4bab730b534a 100644 (file)
@@ -3999,7 +3999,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
                        ui_but_drop     (C, event, but, data);
                }
                /* handle keyframing */
-               else if(event->type == IKEY && event->val == KM_PRESS) {
+               else if(event->type == IKEY && !ELEM3(1, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
                        if(event->alt)
                                ui_but_anim_delete_keyframe(C);
                        else
@@ -4010,7 +4010,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
                        return WM_UI_HANDLER_BREAK;
                }
                /* handle drivers */
-               else if(event->type == DKEY && event->val == KM_PRESS) {
+               else if(event->type == DKEY && !ELEM3(1, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
                        if(event->alt)
                                ui_but_anim_remove_driver(C);
                        else
@@ -4021,7 +4021,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
                        return WM_UI_HANDLER_BREAK;
                }
                /* handle keyingsets */
-               else if(event->type == KKEY && event->val == KM_PRESS) {
+               else if(event->type == KKEY && !ELEM3(1, event->ctrl, event->oskey, event->shift) && event->val == KM_PRESS) {
                        if(event->alt)
                                ui_but_anim_remove_keyingset(C);
                        else