From 3064da1200a97e4fba08be33dd271b09d65a2fde Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 8 Nov 2018 15:59:51 +1100 Subject: 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 --- source/blender/editors/space_buttons/space_buttons.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source/blender/editors/space_buttons/space_buttons.c') diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index a4fc8fbdcc2..1f1f238daf6 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -353,15 +353,7 @@ static void buttons_operatortypes(void) static void buttons_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Property Editor", SPACE_BUTS, 0); - wmKeyMapItem *kmi; - - WM_keymap_add_item(keymap, "BUTTONS_OT_context_menu", RIGHTMOUSE, KM_PRESS, 0, 0); - - kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_PREV); - kmi = WM_keymap_add_item(keymap, "SCREEN_OT_space_context_cycle", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(kmi->ptr, "direction", SPACE_CONTEXT_CYCLE_NEXT); + WM_keymap_ensure(keyconf, "Property Editor", SPACE_BUTS, 0); } /* add handlers, stuff you only do once or on area/region changes */ -- cgit v1.2.3