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
This commit is contained in:
2022-03-02 15:07:00 +11:00
parent 426ff481a7
commit 4986f71848
30 changed files with 372 additions and 461 deletions

View File

@@ -180,6 +180,10 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
subrow.prop(kmi, "type", text="")
subrow.prop(kmi, "value", text="")
if map_type in {'KEYBOARD', 'MOUSE'} and kmi.value == 'CLICK_DRAG':
subrow = sub.row()
subrow.prop(kmi, "direction")
subrow = sub.row()
subrow.scale_x = 0.75
subrow.prop(kmi, "any", toggle=True)