diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-16 00:28:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-16 00:31:00 +0300 |
commit | 088be7eb2f650f7849e3af33cbea76f7b3af0822 (patch) | |
tree | d0248368b79c2787dc87b4ba57cd3d836e36e0f4 /release/scripts/presets/keyconfig/blender.py | |
parent | 8ecc51e87fd0e3e9bb13622456d03d09926eab47 (diff) |
Keymaps: replace select / action mouse system
For Blender builtin configurations the option to choose the select mouse remains
and is now also in the splash screen. It works by changing the keymap dynamically
in the script, rather than using special events.
The system of automatic switching of events was not flexible enough to deal with
side effects that require further keymap changes, so it is now under more manual
control in the script.
This breaks compatibility for some scripts and exported key configurations.
These can be fixed by replacing SELECTMOUSE, ACTIONMOUSE, EVT_TWEAK_S and
EVT_TWEAK_A with appropriate LEFTMOUSE, RIGHTMOUSE, EVT_TWEAK_L and
EVT_TWEAK_R events.
Other than that, there should be no functional changes.
Diffstat (limited to 'release/scripts/presets/keyconfig/blender.py')
-rw-r--r-- | release/scripts/presets/keyconfig/blender.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/release/scripts/presets/keyconfig/blender.py b/release/scripts/presets/keyconfig/blender.py index 66db91d9186..477da63d78f 100644 --- a/release/scripts/presets/keyconfig/blender.py +++ b/release/scripts/presets/keyconfig/blender.py @@ -1,12 +1,23 @@ - import os +import bpy + +userpref = bpy.context.user_preferences + from bpy_extras.keyconfig_utils import ( keyconfig_import_from_data, keyconfig_module_from_preset, ) _mod = keyconfig_module_from_preset(os.path.join("keymap_data", "blender_default"), __file__) -keyconfig_data = _mod.generate_keymaps() +keyconfig_data = _mod.generate_keymaps( + _mod.KeymapParams( + select_mouse=userpref.inputs.select_mouse, + ), +) if __name__ == "__main__": - keyconfig_import_from_data("Blender", keyconfig_data) + kc = keyconfig_import_from_data( + os.path.splitext(os.path.basename(__file__))[0], + keyconfig_data, + ) + kc.has_select_mouse = True # Support switching select mouse |