From dbf5bb7af2e45ea59c7a15346a5ee989828f2d07 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 10 Aug 2020 12:26:48 +0200 Subject: Fix T79640: "Assign Shortcut" doesn't work for "View 2D Zoom" 'VIEW2D_OT' operators were not respected in WM_keymap_guess_opname(). This was seemingly done on purpose (see comment "Op types purposely skipped for now"), but dont really see the reason for doing so. Since the "View2D" keymap is not bound to a specific spacetype, we can still find it using WM_keymap_find_all() [and passing 0 as spacetype]. Reviewers: Severin Subscribers: --- source/blender/windowmanager/intern/wm_keymap_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index 5ab36b15666..460b19ac8d1 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -217,7 +217,6 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) * FLUID_OT * TEXTURE_OT * UI_OT - * VIEW2D_OT * WORLD_OT */ @@ -344,6 +343,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) break; } } + /* General 2D View, not bound to a specific spacetype. */ + else if (STRPREFIX(opname, "VIEW2D_OT")) { + km = WM_keymap_find_all(wm, "View2D", 0, 0); + } /* Image Editor */ else if (STRPREFIX(opname, "IMAGE_OT")) { km = WM_keymap_find_all(wm, "Image", sl->spacetype, 0); -- cgit v1.2.3