Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 10160e9aadc..862e8a09166 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -33,6 +33,7 @@
#include "readfile.h" /* Own include. */
+#include "WM_types.h"
#include "wm_event_types.h"
/* Don't use translation strings in versioning!
@@ -363,10 +364,12 @@ static void do_version_select_mouse(UserDef *userdef, wmKeyMapItem *kmi)
kmi->type = (left) ? RIGHTMOUSE : LEFTMOUSE;
break;
case EVT_TWEAK_S:
- kmi->type = (left) ? EVT_TWEAK_L : EVT_TWEAK_R;
+ kmi->type = (left) ? LEFTMOUSE : RIGHTMOUSE;
+ kmi->val = KM_CLICK_DRAG;
break;
case EVT_TWEAK_A:
- kmi->type = (left) ? EVT_TWEAK_R : EVT_TWEAK_L;
+ kmi->type = (left) ? RIGHTMOUSE : LEFTMOUSE;
+ kmi->val = KM_CLICK_DRAG;
break;
default:
break;
@@ -385,6 +388,39 @@ static bool keymap_item_has_invalid_wm_context_data_path(wmKeyMapItem *kmi,
return false;
}
+static bool keymap_item_update_tweak_event(wmKeyMapItem *kmi, void *UNUSED(user_data))
+{
+ /* Tweak events for L M R mouse-buttons. */
+ enum {
+ EVT_TWEAK_L = 0x5002,
+ EVT_TWEAK_M = 0x5003,
+ EVT_TWEAK_R = 0x5004,
+ };
+ switch (kmi->type) {
+ case EVT_TWEAK_L:
+ kmi->type = LEFTMOUSE;
+ break;
+ case EVT_TWEAK_M:
+ kmi->type = MIDDLEMOUSE;
+ break;
+ case EVT_TWEAK_R:
+ kmi->type = RIGHTMOUSE;
+ break;
+ default:
+ kmi->direction = KM_ANY;
+ return false;
+ }
+
+ if (kmi->val >= EVT_GESTURE_N && kmi->val <= EVT_GESTURE_NW) {
+ kmi->direction = kmi->val;
+ }
+ else {
+ kmi->direction = KM_ANY;
+ }
+ kmi->val = KM_CLICK_DRAG;
+ return false;
+}
+
void blo_do_versions_userdef(UserDef *userdef)
{
/* #UserDef & #Main happen to have the same struct member. */
@@ -952,6 +988,16 @@ void blo_do_versions_userdef(UserDef *userdef)
userdef->ndof_flag |= NDOF_CAMERA_PAN_ZOOM;
}
+ if (!USER_VERSION_ATLEAST(302, 5)) {
+ BKE_keyconfig_pref_filter_items(userdef,
+ &((struct wmKeyConfigFilterItemParams){
+ .check_item = true,
+ .check_diff_item_add = true,
+ }),
+ keymap_item_update_tweak_event,
+ NULL);
+ }
+
/**
* Versioning code until next subversion bump goes here.
*