From c1a5e6b2fd7ae48432da9645f171d8fb1731bc6d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 12 Jul 2015 21:39:59 +0200 Subject: Shortcut-to-string converter: add 'dbl-' in front of key when expecting a double-click. I think this is the only Keymap value we really need to handle here... --- source/blender/windowmanager/WM_keymap.h | 2 +- source/blender/windowmanager/intern/wm_keymap.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index d8787c9ef79..cd42f36d363 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -107,7 +107,7 @@ int WM_keymap_map_type_get(struct wmKeyMapItem *kmi); const char *WM_key_event_string(const short type, const bool compact); int WM_keymap_item_raw_to_string( const short shift, const short ctrl, const short alt, const short oskey, const short keymodifier, - const short type, const bool compact, const int len, char *r_str); + const short val, const short type, const bool compact, const int len, char *r_str); int WM_key_event_operator_id( const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const bool is_hotkey, diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 29d54f47947..e65ce4791e8 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -902,7 +902,7 @@ const char *WM_key_event_string(const short type, const bool compact) /* TODO: also support (some) value, like e.g. double-click? */ int WM_keymap_item_raw_to_string( const short shift, const short ctrl, const short alt, const short oskey, - const short keymodifier, const short type, const bool compact, + const short keymodifier, const short val, const short type, const bool compact, const int len, char *r_str) { #define ADD_SEP if (p != buf) *p++ = ' '; (void)0 @@ -953,6 +953,9 @@ int WM_keymap_item_raw_to_string( if (type) { ADD_SEP; + if (val == KM_DBL_CLICK) { + p += BLI_strcpy_rlen(p, IFACE_("dbl-")); + } p += BLI_strcpy_rlen(p, WM_key_event_string(type, compact)); } @@ -968,7 +971,8 @@ int WM_keymap_item_raw_to_string( int WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, const int len, char *r_str) { return WM_keymap_item_raw_to_string( - kmi->shift, kmi->ctrl, kmi->alt, kmi->oskey, kmi->keymodifier, kmi->type, compact, len, r_str); + kmi->shift, kmi->ctrl, kmi->alt, kmi->oskey, kmi->keymodifier, kmi->val, kmi->type, + compact, len, r_str); } int WM_modalkeymap_operator_items_to_string( -- cgit v1.2.3