Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-12-12 13:39:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-12 13:43:26 +0300
commit4357fb63db77d8bee9b1a3d10fdf6abd55e4c798 (patch)
tree477adefe8069f2e09d091086fbf4bfb2968878fd /source/blender/editors/interface/interface_context_menu.c
parentadaadb2fa0a4fde53f5f09bc05f6758926e71f44 (diff)
Keymap: event type filter w/ finding keymap items
Now its possibly to ask for only keyboard/mouse/ndof events when finding key map items.
Diffstat (limited to 'source/blender/editors/interface/interface_context_menu.c')
-rw-r--r--source/blender/editors/interface/interface_context_menu.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index bbc0f66605c..84460f9f149 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -96,7 +96,10 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *ar, void *arg)
uiStyle *style = UI_style_get_dpi();
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
- kmi = WM_key_event_operator(C, but->optype->idname, but->opcontext, prop, true, &km);
+ kmi = WM_key_event_operator(
+ C, but->optype->idname, but->opcontext, prop,
+ EVT_TYPE_MASK_HOTKEY_INCLUDE, EVT_TYPE_MASK_HOTKEY_EXCLUDE,
+ &km);
BLI_assert(kmi != NULL);
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
@@ -202,7 +205,10 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
wmKeyMapItem *kmi;
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
- kmi = WM_key_event_operator(C, but->optype->idname, but->opcontext, prop, true, &km);
+ kmi = WM_key_event_operator(
+ C, but->optype->idname, but->opcontext, prop,
+ EVT_TYPE_MASK_HOTKEY_INCLUDE, EVT_TYPE_MASK_HOTKEY_EXCLUDE,
+ &km);
BLI_assert(kmi != NULL);
WM_keymap_remove_item(km, kmi);
@@ -708,7 +714,10 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
int w = uiLayoutGetWidth(layout);
wmKeyMap *km;
/* We want to know if this op has a shortcut, be it hotkey or not. */
- wmKeyMapItem *kmi = WM_key_event_operator(C, but->optype->idname, but->opcontext, prop, false, &km);
+ wmKeyMapItem *kmi = WM_key_event_operator(
+ C, but->optype->idname, but->opcontext, prop,
+ EVT_TYPE_MASK_ALL, 0,
+ &km);
/* We do have a shortcut, but only keyboard ones are editable that way... */
if (kmi) {