diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 12 |
3 files changed, 7 insertions, 19 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 34a20b91172..07efcdcbe38 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -201,7 +201,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg) /* XXX this guess_opname can potentially return a different keymap * than being found on adding later... */ wmKeyMap *km = WM_keymap_guess_opname(C, idname); - wmKeyMapItem *kmi = WM_keymap_add_item(km, idname, EVT_AKEY, KM_PRESS, 0, 0); + wmKeyMapItem *kmi = WM_keymap_add_item(km, idname, EVT_AKEY, KM_PRESS, 0, 0, KM_ANY); const int kmi_id = kmi->id; /* This takes ownership of prop, or prop can be NULL for reset. */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c277ca2e36b..e0b64dcd4d6 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9398,7 +9398,7 @@ static int ui_list_activate_hovered_row(bContext *C, } } - const int *mouse_xy = ISTWEAK(event->type) ? event->prev_click_xy : event->xy; + const int *mouse_xy = (event->val == KM_CLICK_DRAG) ? event->prev_click_xy : event->xy; uiBut *listrow = ui_list_row_find_mouse_over(region, mouse_xy); if (listrow) { wmOperatorType *custom_activate_optype = ui_list->dyn_data->custom_activate_optype; @@ -9425,7 +9425,7 @@ static bool ui_list_is_hovering_draggable_but(bContext *C, const wmEvent *event) { /* On a tweak event, uses the coordinates from where tweaking was started. */ - const int *mouse_xy = ISTWEAK(event->type) ? event->prev_click_xy : event->xy; + const int *mouse_xy = (event->val == KM_CLICK_DRAG) ? event->prev_click_xy : event->xy; const uiBut *hovered_but = ui_but_find_mouse_over_ex(region, mouse_xy, false, NULL, NULL); if (list->dyn_data->custom_drag_optype) { @@ -9442,7 +9442,7 @@ static int ui_list_handle_click_drag(bContext *C, ARegion *region, const wmEvent *event) { - if (!ELEM(event->type, LEFTMOUSE, EVT_TWEAK_L)) { + if (event->type != LEFTMOUSE) { return WM_HANDLER_CONTINUE; } @@ -9452,7 +9452,7 @@ static int ui_list_handle_click_drag(bContext *C, bool activate = false; bool activate_dragging = false; - if (event->type == EVT_TWEAK_L) { + if (event->val == KM_CLICK_DRAG) { if (is_draggable) { activate_dragging = true; activate = true; @@ -9462,7 +9462,7 @@ static int ui_list_handle_click_drag(bContext *C, * regular events (including mouse presses to start dragging) and this part only kicks in if it * hasn't handled the release event. Note that if there's no overlaid button, the row selects * on the press event already via regular #UI_BTYPE_LISTROW handling. */ - else if ((event->type == LEFTMOUSE) && (event->val == KM_CLICK)) { + else if (event->val == KM_CLICK) { activate = true; } @@ -9549,7 +9549,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi } } - if (ELEM(event->type, LEFTMOUSE, EVT_TWEAK_L)) { + if (event->type == LEFTMOUSE) { retval = ui_list_handle_click_drag(C, ui_list, region, event); } else if (val == KM_PRESS) { diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index e99f6978f4c..9dfc9be2a30 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -573,18 +573,6 @@ int UI_icon_from_event_type(short event_type, short event_value) else if (event_type == EVT_RIGHTALTKEY) { event_type = EVT_LEFTALTKEY; } - else if (event_type == EVT_TWEAK_L) { - event_type = LEFTMOUSE; - event_value = KM_CLICK_DRAG; - } - else if (event_type == EVT_TWEAK_M) { - event_type = MIDDLEMOUSE; - event_value = KM_CLICK_DRAG; - } - else if (event_type == EVT_TWEAK_R) { - event_type = RIGHTMOUSE; - event_value = KM_CLICK_DRAG; - } DrawInfo *di = g_di_event_list; do { |