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:
This commit is contained in:
parent
2fc2a0a56b
commit
dbf5bb7af2
Notes:
blender-bot
2023-02-13 23:16:02 +01:00
Referenced by issue #79640, "Assign Shortcut" doesn't work for "View 2D Zoom"
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue