e-key to access the eyedropper over a color button.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 8 Oct 2013 13:58:28 +0000 (13:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 8 Oct 2013 13:58:28 +0000 (13:58 +0000)
source/blender/editors/interface/interface_handlers.c

index fc8ced14096af18a012f7842aa5ee8a121fdf9ba..77eb4a81928586012971beb4689c0d2b7ccaea2d 100644 (file)
@@ -5405,6 +5405,18 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                else if (event->type == EVT_DROP) {
                        ui_but_drop(C, event, but, data);
                }
+               /* handle eyedropper */
+               else if ((event->type == EKEY) && (event->val == KM_PRESS)) {
+                       if (event->alt || event->shift || event->ctrl || event->oskey) {
+                               /* pass */
+                       }
+                       else {
+                               if (but->type == COLOR) {
+                                       WM_operator_name_call(C, "UI_OT_eyedropper_color", WM_OP_INVOKE_DEFAULT, NULL);
+                                       return WM_UI_HANDLER_BREAK;
+                               }
+                       }
+               }
                /* handle keyframing */
                else if ((event->type == IKEY) &&
                         !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey) &&