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:
authorCampbell Barton <campbell@blender.org>2022-03-02 07:07:00 +0300
committerCampbell Barton <campbell@blender.org>2022-03-02 07:31:50 +0300
commit4986f718482b061082936f1f6aa13929741093a2 (patch)
tree21ea0b78e1182d35b44b4955ff308b8df1148b19 /source/blender/makesdna/DNA_windowmanager_types.h
parent426ff481a789017bd5810a2064ec06a298a6f2dc (diff)
Event System: remove tweak events in favor of click-drag
Supporting two kinds of dragging is redundant, remove tweak events as they only supported 3 mouse buttons and added complexity from using the 'value' to store directions. Support only click-drag events (KM_CLICK_DRAG) which can be used with any keyboard or mouse button. Details: - A "direction" member has been added to keymap items and events which can be used when the event value is set to KM_CLICK_DRAG. - Keymap items are version patched. - Loading older key-maps are also updated. - Currently the key-maps stored in ./release/scripts/presets/keyconfig/ still reference tweak events & need updating. For now they are updated on load. Note that in general this wont impact add-ons as modal operators don't receive tweak events. Reviewed By: brecht Ref D14214
Diffstat (limited to 'source/blender/makesdna/DNA_windowmanager_types.h')
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 626c2b2a81f..dabef04583b 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -295,9 +295,6 @@ typedef struct wmWindow {
/** Storage for event system. */
struct wmEvent *eventstate;
- /** Internal for wm_operators.c. */
- struct wmGesture *tweak;
-
/* Input Method Editor data - complex character input (especially for Asian character input)
* Currently WIN32 and APPLE, runtime-only data. */
struct wmIMEData *ime_data;
@@ -364,7 +361,9 @@ typedef struct wmKeyMapItem {
/** Event code itself. */
short type;
/** KM_ANY, KM_PRESS, KM_NOTHING etc. */
- short val;
+ int8_t val;
+ /** Use when `val == WM_CLICK_DRAG`, */
+ int8_t direction;
/** `oskey` also known as apple, windows-key or super, value denotes order of pressed. */
short shift, ctrl, alt, oskey;
/** Raw-key modifier. */
@@ -422,7 +421,7 @@ enum {
enum {
KMI_TYPE_KEYBOARD = 0,
KMI_TYPE_MOUSE = 1,
- KMI_TYPE_TWEAK = 2,
+ /* 2 is deprecated, was tweak. */
KMI_TYPE_TEXTINPUT = 3,
KMI_TYPE_TIMER = 4,
KMI_TYPE_NDOF = 5,