diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-19 16:24:18 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-19 16:50:59 +0400 |
commit | 28c6982b3721e8e7e6d850f40e9208d47a64afed (patch) | |
tree | 170cda9d9eb531a36f8f2ef19b5c73032def0e0e /source/blender/windowmanager/intern/wm_keymap.c | |
parent | 3196a230a6b2481dc4b659bc458aea10f5cdd2ed (diff) |
Fix T41477: Some UI op buttons have no more option to edit shortcuts.
`WM_keymap_guess_opname()` was missing a bunch of op 'types'/familly. Now all are there,
either trying to find a matching keymap, or explicitely listed in a comment as skipped for now.
Note matching might not be perfect in all case, but we can easily tweak that later if needed.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 131ab20a3d4..2ed44d14694 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -1421,6 +1421,20 @@ wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id) /* Needs to be kept up to date with Keymap and Operator naming */ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) { + /* Op types purposely skipped for now: + * BRUSH_OT + * BOID_OT + * BUTTONS_OT + * CONSTRAINT_OT + * DPAINT_OT + * ED_OT + * FLUID_OT + * TEXTURE_OT + * UI_OT + * VIEW2D_OT + * WORLD_OT + */ + wmKeyMap *km = NULL; SpaceLink *sl = CTX_wm_space_data(C); @@ -1428,8 +1442,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) if (strstr(opname, "WM_OT")) { km = WM_keymap_find_all(C, "Window", 0, 0); } - /* Screen */ - else if (strstr(opname, "SCREEN_OT")) { + /* Screen & Render */ + else if (strstr(opname, "SCREEN_OT") || strstr(opname, "RENDER_OT") || strstr(opname, "SOUND_OT") || + strstr(opname, "SCENE_OT")) + { km = WM_keymap_find_all(C, "Screen", 0, 0); } /* Grease Pencil */ @@ -1457,7 +1473,12 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) else km = WM_keymap_find_all(C, "Object Mode", 0, 0); } - + /* Object mode related */ + else if (strstr(opname, "GROUP_OT") || strstr(opname, "MATERIAL_OT") || strstr(opname, "PTCACHE_OT") || + strstr(opname, "RIGIDBODY_OT")) + { + km = WM_keymap_find_all(C, "Object Mode", 0, 0); + } /* Editing Modes */ else if (strstr(opname, "MESH_OT")) { @@ -1468,7 +1489,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) km = WM_keymap_find_all(C, "Object Mode", 0, 0); } } - else if (strstr(opname, "CURVE_OT")) { + else if (strstr(opname, "CURVE_OT") || strstr(opname, "SURFACE_OT")) { km = WM_keymap_find_all(C, "Curve", 0, 0); /* some curve operators are active in object mode too, like add-prim */ @@ -1476,10 +1497,10 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) km = WM_keymap_find_all(C, "Object Mode", 0, 0); } } - else if (strstr(opname, "ARMATURE_OT")) { + else if (strstr(opname, "ARMATURE_OT") || strstr(opname, "SKETCH_OT")) { km = WM_keymap_find_all(C, "Armature", 0, 0); } - else if (strstr(opname, "POSE_OT")) { + else if (strstr(opname, "POSE_OT") || strstr(opname, "POSELIB_OT")) { km = WM_keymap_find_all(C, "Pose", 0, 0); } else if (strstr(opname, "SCULPT_OT")) { @@ -1536,6 +1557,13 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) else if (strstr(opname, "IMAGE_OT")) { km = WM_keymap_find_all(C, "Image", sl->spacetype, 0); } + /* Clip Editor */ + else if (strstr(opname, "CLIP_OT")) { + km = WM_keymap_find_all(C, "Clip", sl->spacetype, 0); + } + else if (strstr(opname, "MASK_OT")) { + km = WM_keymap_find_all(C, "Mask Editing", 0, 0); + } /* UV Editor */ else if (strstr(opname, "UV_OT")) { km = WM_keymap_find_all(C, "UV Editor", sl->spacetype, 0); @@ -1584,10 +1612,21 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) else if (strstr(opname, "INFO_OT")) { km = WM_keymap_find_all(C, "Info", sl->spacetype, 0); } + /* File browser */ + else if (strstr(opname, "FILE_OT")) { + km = WM_keymap_find_all(C, "File Browser", sl->spacetype, 0); + } + /* Logic Editor */ + else if (strstr(opname, "LOGIC_OT")) { + km = WM_keymap_find_all(C, "Logic Editor", sl->spacetype, 0); + } + /* Outliner */ + else if (strstr(opname, "OUTLINER_OT")) { + km = WM_keymap_find_all(C, "Outliner", sl->spacetype, 0); + } /* Transform */ else if (strstr(opname, "TRANSFORM_OT")) { - /* check for relevant editor */ switch (sl->spacetype) { case SPACE_VIEW3D: |