From 448216aa23b49fe87f98d722398422cf700f553d Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 2 Mar 2023 19:37:30 +0100 Subject: [PATCH 1/2] UI: Make it possible to add shortcuts to UI operators. Note: This patch originates from investigation of #105371. I have noticed, thatthis has been intentionally disabled, but it was long time ago without any comment why and `PAINT_OT` already violates this. So consider it as if I was proposing this blindly. Perhaps it make sense to exclude specific UI operators if some are problematic? --- source/blender/windowmanager/intern/wm_keymap_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index cf8c0ebb859..e7bdc6e2331 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -446,6 +446,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; } -- 2.30.2 From a6c41f613a93f8e6fa9dc134acdea978017d6327 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 2 Mar 2023 19:48:41 +0100 Subject: [PATCH 2/2] Remove UI from excluded operators --- source/blender/windowmanager/intern/wm_keymap_utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index e7bdc6e2331..c3199c6b0f8 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 */ -- 2.30.2