Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 2,391 Lines • ▼ Show 20 Lines | if (wm_action_not_handled(action)) { | ||||
| if (win && event->val == KM_PRESS) { | if (win && event->val == KM_PRESS) { | ||||
| win->eventstate->check_click = true; | win->eventstate->check_click = true; | ||||
| } | } | ||||
| if (win && win->eventstate->prevtype == event->type) { | if (win && win->eventstate->prevtype == event->type) { | ||||
| if ((event->val == KM_RELEASE) && | if ((event->val == KM_RELEASE) && | ||||
| (win->eventstate->prevval == KM_PRESS) && | (win->eventstate->prevval == KM_PRESS) && | ||||
| (win->eventstate->check_click == true)) | (win->eventstate->check_click == true) && | ||||
| ((ABS(event->x - win->eventstate->prevclickx)) <= 2 && | |||||
| (ABS(event->y - win->eventstate->prevclicky)) <= 2)) | |||||
| { | { | ||||
| event->val = KM_CLICK; | event->val = KM_CLICK; | ||||
| if (G.debug & (G_DEBUG_HANDLERS)) { | if (G.debug & (G_DEBUG_HANDLERS)) { | ||||
| printf("%s: handling CLICK\n", __func__); | printf("%s: handling CLICK\n", __func__); | ||||
| } | } | ||||
| action |= wm_handlers_do_intern(C, event, handlers); | action |= wm_handlers_do_intern(C, event, handlers); | ||||
| ▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | #endif | ||||
| if (!BLI_listbase_is_empty(&wm->drags)) { | if (!BLI_listbase_is_empty(&wm->drags)) { | ||||
| /* does polls for drop regions and checks uibuts */ | /* does polls for drop regions and checks uibuts */ | ||||
| /* need to be here to make sure region context is true */ | /* need to be here to make sure region context is true */ | ||||
| if (ELEM(event->type, MOUSEMOVE, EVT_DROP) || ISKEYMODIFIER(event->type)) { | if (ELEM(event->type, MOUSEMOVE, EVT_DROP) || ISKEYMODIFIER(event->type)) { | ||||
| wm_drags_check_ops(C, event); | wm_drags_check_ops(C, event); | ||||
| } | } | ||||
| } | } | ||||
| /* -------------------------------------------------------------------- */ | |||||
| wmEventHandler sneaky_handler = {NULL}; | |||||
| if (ar->regiontype == RGN_TYPE_WINDOW) { | |||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | |||||
| if (workspace->tool_active_keymap[0] && | |||||
| workspace->tool_active_spacetype == sa->spacetype) | |||||
| { | |||||
| wmKeyMap *km = WM_keymap_find_all( | |||||
| C, workspace->tool_active_keymap, sa->spacetype, RGN_TYPE_WINDOW); | |||||
| if (km != NULL) { | |||||
| sneaky_handler.keymap = km; | |||||
| BLI_addhead(&ar->handlers, &sneaky_handler); | |||||
| } | |||||
| } | |||||
| } | |||||
| /* -------------------------------------------------------------------- */ | |||||
| action |= wm_handlers_do(C, event, &ar->handlers); | action |= wm_handlers_do(C, event, &ar->handlers); | ||||
| if (sneaky_handler.keymap) { | |||||
| BLI_remlink(&ar->handlers, &sneaky_handler); | |||||
| } | |||||
| /* fileread case (python), [#29489] */ | /* fileread case (python), [#29489] */ | ||||
| if (CTX_wm_window(C) == NULL) | if (CTX_wm_window(C) == NULL) | ||||
| return; | return; | ||||
| if (action & WM_HANDLER_BREAK) | if (action & WM_HANDLER_BREAK) | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,197 Lines • Show Last 20 Lines | |||||