diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-13 10:34:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-13 10:34:22 +0300 |
commit | e1772dac7065c92859a1db40ccb569b570b0159a (patch) | |
tree | 11ad1639ae8989d8371fe603e8ddd4bbfacc493c /source/blender/windowmanager/intern | |
parent | cee39da318f23904e334cc98cdd1e6fb100297d6 (diff) |
WM: utility to create tool keybindings
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 27b9710cb45..63f81ca66c9 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -508,6 +508,14 @@ wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int t 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) +{ + wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_tool_set_by_name", type, val, modifier, keymodifier); + RNA_string_set(kmi->ptr, "name", idname); + return kmi; +} + bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi) { if (BLI_findindex(&keymap->items, kmi) != -1) { |