diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-12 22:39:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-07-12 22:39:59 +0300 |
commit | c1a5e6b2fd7ae48432da9645f171d8fb1731bc6d (patch) | |
tree | 4fa7bbf4119cef2e2555010788a118a50cb7cd21 /source/blender/windowmanager/intern | |
parent | c2bcf2dc05715995cafa2f746943e50553f754dc (diff) |
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...
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 8 |
1 files changed, 6 insertions, 2 deletions
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( |