diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/WM_keymap.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index d1f6d268835..afde7f64b81 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -66,6 +66,10 @@ wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, in int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); +wmKeyMapItem *WM_keymap_add_panel( + struct wmKeyMap *keymap, + short space_type, short region_type, const char *idname, + int type, int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_tool(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 9c435297069..82363c4c21b 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -509,6 +509,20 @@ wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int t return kmi; } +wmKeyMapItem *WM_keymap_add_panel( + wmKeyMap *keymap, + short space_type, short region_type, const char *idname, + int type, int val, int modifier, int keymodifier) +{ + wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_panel", type, val, modifier, keymodifier); + RNA_enum_set(kmi->ptr, "space_type", space_type); + RNA_enum_set(kmi->ptr, "region_type", region_type); + RNA_string_set(kmi->ptr, "name", idname); + /* TODO: we might want to disable this. */ + RNA_boolean_set(kmi->ptr, "keep_open", false); + return kmi; +} + /* tool wrapper for WM_keymap_add_item */ wmKeyMapItem *WM_keymap_add_tool(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier) { |