diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-09-21 21:05:49 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-09-21 21:09:37 +0300 |
commit | f6c09eadf06161d185835757afbf40c6512cc7cc (patch) | |
tree | 234a7d522dd0a6a23cfb4f1d6b66fd5e7ff78492 /source/blender/editors/interface | |
parent | a3d258bfb49c4560bdb91fbedbfa8536641e2133 (diff) |
UI: Make button driver and keying set shortcuts configurable
Diffstat (limited to 'source/blender/editors/interface')
4 files changed, 8 insertions, 61 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 5c4560bb0ec..991cd54fecf 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -272,18 +272,6 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) } } -void ui_but_anim_add_driver(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_driver_button_add", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_remove_driver(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_driver_button_remove", WM_OP_INVOKE_DEFAULT, NULL); -} - void ui_but_anim_copy_driver(bContext *C) { /* this operator calls UI_context_active_but_prop_get */ @@ -295,15 +283,3 @@ void ui_but_anim_paste_driver(bContext *C) /* this operator calls UI_context_active_but_prop_get */ WM_operator_name_call(C, "ANIM_OT_paste_driver_button", WM_OP_INVOKE_DEFAULT, NULL); } - -void ui_but_anim_add_keyingset(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyingset_button_add", WM_OP_INVOKE_DEFAULT, NULL); -} - -void ui_but_anim_remove_keyingset(bContext *C) -{ - /* this operator calls UI_context_active_but_prop_get */ - WM_operator_name_call(C, "ANIM_OT_keyingset_button_remove", WM_OP_INVOKE_DEFAULT, NULL); -} diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 29c9c03baf9..c40260a8454 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7040,36 +7040,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } } } - /* handle drivers */ - else if ((event->type == DKEY) && - !IS_EVENT_MOD(event, shift, oskey) && - (event->val == KM_PRESS)) - { - /* quick check to prevent this opening within the popup menu its self */ - if (!ELEM(NULL, but->rnapoin.data, but->rnaprop)) { - if (event->alt) - ui_but_anim_remove_driver(C); - else if (event->ctrl) - ui_but_anim_add_driver(C); - - ED_region_tag_redraw(data->region); - } - return WM_UI_HANDLER_BREAK; - } - /* handle keyingsets */ - else if ((event->type == KKEY) && - !IS_EVENT_MOD(event, shift, ctrl, oskey) && - (event->val == KM_PRESS)) - { - if (event->alt) - ui_but_anim_remove_keyingset(C); - else - ui_but_anim_add_keyingset(C); - - ED_region_tag_redraw(data->region); - - return WM_UI_HANDLER_BREAK; - } /* handle menu */ else if ((event->type == RIGHTMOUSE) && !IS_EVENT_MOD(event, shift, ctrl, alt, oskey) && diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 418d98e8e4a..fcf827bdbe6 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -729,15 +729,8 @@ void ui_block_align_calc(uiBlock *block); /* interface_anim.c */ void ui_but_anim_flag(uiBut *but, float cfra); -void ui_but_anim_insert_keyframe(struct bContext *C); -void ui_but_anim_delete_keyframe(struct bContext *C); -void ui_but_anim_clear_keyframe(struct bContext *C); -void ui_but_anim_add_driver(struct bContext *C); -void ui_but_anim_remove_driver(struct bContext *C); void ui_but_anim_copy_driver(struct bContext *C); void ui_but_anim_paste_driver(struct bContext *C); -void ui_but_anim_add_keyingset(struct bContext *C); -void ui_but_anim_remove_keyingset(struct bContext *C); bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen); bool ui_but_anim_expression_set(uiBut *but, const char *str); bool ui_but_anim_expression_create(uiBut *but, const char *str); diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index ce23588f821..77b5367c3e9 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1121,5 +1121,13 @@ void ED_keymap_ui(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "ANIM_OT_keyframe_delete_button", IKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ANIM_OT_keyframe_clear_button", IKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0); + /* drivers */ + WM_keymap_add_item(keymap, "ANIM_OT_driver_button_add", DKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "ANIM_OT_driver_button_remove", DKEY, KM_PRESS, KM_CTRL | KM_ALT, 0); + + /* keyingsets */ + WM_keymap_add_item(keymap, "ANIM_OT_keyingset_button_add", KKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_keyingset_button_remove", KKEY, KM_PRESS, KM_ALT, 0); + eyedropper_modal_keymap(keyconf); } |