diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-20 06:29:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-20 06:37:15 +0300 |
commit | effe750ec103d56ff96f12ce64ac977a8ae51909 (patch) | |
tree | fd081fdade0458fa388b55d277034aa38588d146 /source/blender/editors/screen | |
parent | 855b3e68ef272f6ddb3b496cf8e6d074733e99d4 (diff) |
WM: support dynamic keymap handlers
Add getter callback support for 'WM_HANDLER_TYPE_KEYMAP' type handlers
this is needed for key-maps which change based on the active tool.
Replaces 'sneaky_handler' hack which temporarily inserted a handler.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 6df0702b126..32b85b40950 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1474,6 +1474,9 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ARegion *ar, L WM_gizmomap_add_handlers(ar, ar->gizmo_map); } } + if (flag & ED_KEYMAP_TOOL) { + WM_event_add_keymap_handler_dynamic(&ar->handlers, WM_event_get_keymap_from_toolsystem, sa); + } if (flag & ED_KEYMAP_VIEW2D) { /* 2d-viewport handling+manipulation */ wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "View2D", 0, 0); |