From 35a8341d7bd74cdabf334ea341bbbf2cfd0f1a0a Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Fri, 21 Apr 2023 17:09:41 +0200 Subject: [PATCH] UI: Make it possible to add shortcuts to UI operators. Function `WM_keymap_guess_opname()` skipped `UI_OT` operator types. In some cases this is detremental to workflow, see #105371. To exclude operators from getting keyboard shortcut it was suggested by Campbell to use flag `OPTYPE_INTERNAL` or make new one. Pull Request: https://projects.blender.org/blender/blender/pulls/105383 --- source/blender/windowmanager/intern/wm_keymap_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index 3126a06b134..10ef02f3829 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -183,7 +183,6 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) * ED_OT * FLUID_OT * TEXTURE_OT - * UI_OT * WORLD_OT */ @@ -446,6 +445,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) break; } } + /* User Interface */ + else if (STRPREFIX(opname, "UI_OT")) { + km = WM_keymap_find_all(wm, "User Interface", 0, 0); + } return km; }