UI: include 'drag-' prefix in the short-cut text for menu items

This was already done for double-click events but not drag events.
This commit is contained in:
Campbell Barton 2023-01-11 17:54:12 +11:00
parent 86464cfcef
commit d8d20e0e59
2 changed files with 9 additions and 3 deletions

View File

@ -390,11 +390,14 @@ typedef struct wmKeyMapItem {
short propvalue;
/* event */
/** Event code itself. */
/** Event code itself (#EVT_LEFTCTRLKEY, #LEFTMOUSE etc). */
short type;
/** KM_ANY, KM_PRESS, KM_NOTHING etc. */
/** Button state (#KM_ANY, #KM_PRESS, #KM_DBL_CLICK, #KM_CLICK_DRAG, #KM_NOTHING etc). */
int8_t val;
/** Use when `val == KM_CLICK_DRAG`. */
/**
* The 2D direction of the event to use when `val == KM_CLICK_DRAG`.
* Set to #KM_DIRECTION_N, #KM_DIRECTION_S & related values, #KM_NOTHING for any direction.
*/
int8_t direction;
/** `oskey` also known as apple, windows-key or super. */
short shift, ctrl, alt, oskey;

View File

@ -1197,6 +1197,9 @@ int WM_keymap_item_raw_to_string(const short shift,
if (val == KM_DBL_CLICK) {
p += BLI_strcpy_rlen(p, IFACE_("dbl-"));
}
else if (val == KM_CLICK_DRAG) {
p += BLI_strcpy_rlen(p, IFACE_("drag-"));
}
p += BLI_strcpy_rlen(p, WM_key_event_string(type, compact));
}