Add User Interface keymap (no items yet)

Needed to allow modal UI keymaps, but I'm sure we'll need this more often in future.
First item will be modal eyedropper keymap coming in a following commit.
This commit is contained in:
Julian Eisel 2016-02-29 17:40:19 +01:00
parent e61588c5a5
commit 84b1d67b64
4 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,10 @@ KM_HIERARCHY = [
('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
('User Interface', 'EMPTY', 'WINDOW', [
# empty
]),
('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
('Object Mode', 'EMPTY', 'WINDOW', []),
('Mesh', 'EMPTY', 'WINDOW', []),

View File

@ -62,6 +62,7 @@ struct uiFontStyle;
struct uiWidgetColors;
struct Image;
struct ImageUser;
struct wmKeyConfig;
struct wmOperatorType;
struct uiWidgetColors;
struct MTex;
@ -1004,6 +1005,8 @@ typedef struct uiDragColorHandle {
} uiDragColorHandle;
void ED_button_operatortypes(void);
void ED_keymap_ui(struct wmKeyConfig *keyconf);
void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop);
int UI_drop_color_poll(struct bContext *C, struct wmDrag *drag, const struct wmEvent *event);

View File

@ -1108,3 +1108,13 @@ void ED_button_operatortypes(void)
WM_operatortype_append(UI_OT_eyedropper_id);
WM_operatortype_append(UI_OT_eyedropper_depth);
}
/**
* \brief User Interface Keymap
*
* For now only modal maps here, since UI uses special ui-handlers instead of operators.
*/
void ED_keymap_ui(wmKeyConfig *keyconf)
{
WM_keymap_find(keyconf, "User Interface", 0, 0);
}

View File

@ -188,6 +188,7 @@ void ED_spacetypes_keymap(wmKeyConfig *keyconf)
ED_keymap_marker(keyconf);
ED_keymap_view2d(keyconf);
ED_keymap_ui(keyconf);
spacetypes = BKE_spacetypes_list();
for (stype = spacetypes->first; stype; stype = stype->next) {