Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 2,869 Lines • ▼ Show 20 Lines | #ifdef USE_WORKSPACE_TOOL | ||||
| * | * | ||||
| * Need to investigate how this could be done better. | * Need to investigate how this could be done better. | ||||
| * We might need to add a more dynamic handler type that uses a callback | * We might need to add a more dynamic handler type that uses a callback | ||||
| * to fetch its current keymap. | * to fetch its current keymap. | ||||
| */ | */ | ||||
| wmEventHandler sneaky_handler = {NULL}; | wmEventHandler sneaky_handler = {NULL}; | ||||
| if (ar->regiontype == RGN_TYPE_WINDOW) { | if (ar->regiontype == RGN_TYPE_WINDOW) { | ||||
| WorkSpace *workspace = WM_window_get_active_workspace(win); | WorkSpace *workspace = WM_window_get_active_workspace(win); | ||||
| if (workspace->tool.keymap[0] && | const bToolKey tkey = { | ||||
| workspace->tool.spacetype == sa->spacetype) | .space_type = sa->spacetype, | ||||
| { | .mode = WM_toolsystem_mode_from_spacetype(workspace, win->scene, sa, sa->spacetype), | ||||
| }; | |||||
| bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_find(workspace, &tkey); | |||||
| if (tref_rt && tref_rt->keymap[0]) { | |||||
| wmKeyMap *km = WM_keymap_find_all( | wmKeyMap *km = WM_keymap_find_all( | ||||
| C, workspace->tool.keymap, sa->spacetype, RGN_TYPE_WINDOW); | C, tref_rt->keymap, sa->spacetype, RGN_TYPE_WINDOW); | ||||
| if (km != NULL) { | if (km != NULL) { | ||||
| sneaky_handler.keymap = km; | sneaky_handler.keymap = km; | ||||
| /* Handle widgets first. */ | /* Handle widgets first. */ | ||||
| wmEventHandler *handler_last = ar->handlers.last; | wmEventHandler *handler_last = ar->handlers.last; | ||||
| while (handler_last && handler_last->manipulator_map == NULL) { | while (handler_last && handler_last->manipulator_map == NULL) { | ||||
| handler_last = handler_last->prev; | handler_last = handler_last->prev; | ||||
| } | } | ||||
| /* Head of list or after last manipulator. */ | /* Head of list or after last manipulator. */ | ||||
| ▲ Show 20 Lines • Show All 1,222 Lines • Show Last 20 Lines | |||||