diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-08 22:40:03 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-08 22:40:03 +0400 |
commit | 3ebd58673fb9a8c5ef13048b2e8e8a4cb7bb3a4e (patch) | |
tree | 81031f2772990c6292eafce955d09897a8e40d6f /source/blender/editors/space_file/space_file.c | |
parent | e0c5e484732bb344fb845acc2678777e4bff1d5c (diff) |
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
Diffstat (limited to 'source/blender/editors/space_file/space_file.c')
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 77f50d91e77..4d3376e0e1f 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -253,10 +253,10 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymaps */ - keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "FileMain", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); @@ -364,11 +364,11 @@ void file_operatortypes(void) } /* NOTE: do not add .blend file reading on this level */ -void file_keymap(struct wmWindowManager *wm) +void file_keymap(struct wmKeyConfig *keyconf) { - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* keys for all areas */ - wmKeyMap *keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "File", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); @@ -380,7 +380,7 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_delete", DELKEY, KM_PRESS, 0, 0); /* keys for main area */ - keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0); + keymap= WM_keymap_find(keyconf, "FileMain", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); @@ -401,7 +401,7 @@ void file_keymap(struct wmWindowManager *wm) RNA_int_set(kmi->ptr, "increment",-100); /* keys for button area (top) */ - keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0); + keymap= WM_keymap_find(keyconf, "FileButtons", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "increment", 1); @@ -425,7 +425,7 @@ static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); /* own keymaps */ - keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -461,10 +461,10 @@ static void file_ui_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "FileButtons", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } |