diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-08 07:59:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-09 03:33:06 +0300 |
commit | 3064da1200a97e4fba08be33dd271b09d65a2fde (patch) | |
tree | dc040c83de9ec8a828c9733e04dbb398cd174465 /source/blender/editors/space_info | |
parent | b43ce7908fbb4be7ed2d230579c836aa7045d2c7 (diff) |
Keymap: move builtin keymaps from C to Python
This should be purely an implementation change,
for end users there should be no functional difference.
The entire key configuration is in one file with ~5000 lines of code.
Mostly avoiding code duplication and preserve comments and utility
functions from the C code.
It's a bit long but for searching and editing it's also convenient to
have it all in one file.
Notes:
- Actual keymap is shared by blender / blender_legacy
and stored in `keymap_data/blender_default.py`
This only generates JSON-like data to be passed into
`keyconfig_import_from_data`, allowing other presets to load and
manipulate the default keymap.
- Each preset defines 'keyconfig_data'
which can be shared between presets.
- Some of the utility functions for generating keymap items still
need to be ported over to Python.
- Some keymap items can be made into loops (marked as TODO).
See: D3907
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index ab7d688cebb..d2b6d07541e 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -207,28 +207,8 @@ static void info_operatortypes(void) static void info_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Window", 0, 0); - - WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMERREPORT, KM_ANY, KM_ANY, 0); - - /* info space */ - keymap = WM_keymap_ensure(keyconf, "Info", SPACE_INFO, 0); - - - /* report selection */ - WM_keymap_add_item(keymap, "INFO_OT_select_pick", SELECTMOUSE, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "INFO_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "INFO_OT_select_box", BKEY, KM_PRESS, 0, 0); - - WM_keymap_add_item(keymap, "INFO_OT_report_replay", RKEY, KM_PRESS, 0, 0); - - WM_keymap_add_item(keymap, "INFO_OT_report_delete", XKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "INFO_OT_report_delete", DELKEY, KM_PRESS, 0, 0); - - WM_keymap_add_item(keymap, "INFO_OT_report_copy", CKEY, KM_PRESS, KM_CTRL, 0); -#ifdef __APPLE__ - WM_keymap_add_item(keymap, "INFO_OT_report_copy", CKEY, KM_PRESS, KM_OSKEY, 0); -#endif + WM_keymap_ensure(keyconf, "Window", 0, 0); + WM_keymap_ensure(keyconf, "Info", SPACE_INFO, 0); } /* add handlers, stuff you only do once or on area/region changes */ |