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 /source/blender/makesrna/intern/rna_wm.c | |
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 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 4e79c516ae3..d7c256c2223 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -74,8 +74,6 @@ static const EnumPropertyItem event_tweak_type_items[] = { {EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Left", ""}, {EVT_TWEAK_M, "EVT_TWEAK_M", 0, "Middle", ""}, {EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Right", ""}, - {EVT_TWEAK_A, "EVT_TWEAK_A", 0, "Action", ""}, - {EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Select", ""}, {0, NULL, 0, NULL, NULL} }; @@ -87,8 +85,6 @@ static const EnumPropertyItem event_mouse_type_items[] = { {BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5", ""}, {BUTTON6MOUSE, "BUTTON6MOUSE", 0, "Button6", ""}, {BUTTON7MOUSE, "BUTTON7MOUSE", 0, "Button7", ""}, - {ACTIONMOUSE, "ACTIONMOUSE", 0, "Action", ""}, - {SELECTMOUSE, "SELECTMOUSE", 0, "Select", ""}, {0, "", 0, NULL, NULL}, {TABLET_STYLUS, "PEN", 0, "Pen", ""}, {TABLET_ERASER, "ERASER", 0, "Eraser", ""}, @@ -184,8 +180,6 @@ const EnumPropertyItem rna_enum_event_type_items[] = { {BUTTON5MOUSE, "BUTTON5MOUSE", 0, "Button5 Mouse", "MB5"}, {BUTTON6MOUSE, "BUTTON6MOUSE", 0, "Button6 Mouse", "MB6"}, {BUTTON7MOUSE, "BUTTON7MOUSE", 0, "Button7 Mouse", "MB7"}, - {ACTIONMOUSE, "ACTIONMOUSE", 0, "Action Mouse", "MBA"}, - {SELECTMOUSE, "SELECTMOUSE", 0, "Select Mouse", "MBS"}, {0, "", 0, NULL, NULL}, {TABLET_STYLUS, "PEN", 0, "Pen", ""}, {TABLET_ERASER, "ERASER", 0, "Eraser", ""}, @@ -204,8 +198,6 @@ const EnumPropertyItem rna_enum_event_type_items[] = { {EVT_TWEAK_L, "EVT_TWEAK_L", 0, "Tweak Left", "TwkL"}, {EVT_TWEAK_M, "EVT_TWEAK_M", 0, "Tweak Middle", "TwkM"}, {EVT_TWEAK_R, "EVT_TWEAK_R", 0, "Tweak Right", "TwkR"}, - {EVT_TWEAK_A, "EVT_TWEAK_A", 0, "Tweak Action", "TwkA"}, - {EVT_TWEAK_S, "EVT_TWEAK_S", 0, "Tweak Select", "TwkS"}, {0, "", 0, NULL, NULL}, {AKEY, "A", 0, "A", ""}, {BKEY, "B", 0, "B", ""}, @@ -2241,6 +2233,10 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "User Defined", "Indicates that a keyconfig was defined by the user"); + prop = RNA_def_property(srna, "has_select_mouse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "has_select_mouse", 1); + RNA_def_property_ui_text(prop, "Has Select Mouse", "Configuration supports select mouse switching"); + RNA_api_keyconfig(srna); /* KeyMap */ |