Commit: dbf5bb7af2e45ea59c7a15346a5ee989828f2d07
Author: Philipp Oeser
Date:   Mon Aug 10 12:26:48 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBdbf5bb7af2e45ea59c7a15346a5ee989828f2d07

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:

===================================================================

M       source/blender/windowmanager/intern/wm_keymap_utils.c

===================================================================

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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to