Keymap: orbit/pan preference now applies to the track-pad as well

Ref D7279
This commit is contained in:
Yevgeny Makarov 2020-09-25 14:39:45 +10:00 committed by Campbell Barton
parent aead4b3cab
commit b3e1620e21
2 changed files with 10 additions and 6 deletions

View File

@ -121,14 +121,16 @@ class Prefs(bpy.types.KeyConfigPreferences):
name="MMB Action",
items=(
('ORBIT', "Orbit",
"Orbit",
"",
0),
('PAN', "Pan",
"Set the view axis where each mouse direction always maps to the same axis",
"",
1),
),
description=(
"The action when Middle-Mouse dragging in the viewport. Shift-Middle-Mouse is used for the other action"
"The action when Middle-Mouse dragging in the viewport. "
"Shift-Middle-Mouse is used for the other action. "
"This applies to Track-Pad as well"
),
update=update_fn,
)

View File

@ -1008,12 +1008,17 @@ def km_view3d(params):
("view3d.localview", {"type": 'MOUSESMARTZOOM', "value": 'ANY'}, None),
("view3d.localview_remove_from", {"type": 'M', "value": 'PRESS'}, None),
# Navigation.
("view3d.rotate", {"type": 'MOUSEROTATE', "value": 'ANY'}, None),
*((
("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None),
("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
("view3d.rotate", {"type": 'TRACKPADPAN', "value": 'ANY', "shift": True}, None),
("view3d.move", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
) if params.use_v3d_mmb_pan else (
("view3d.rotate", {"type": 'MIDDLEMOUSE', "value": 'PRESS'}, None),
("view3d.move", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True}, None),
("view3d.rotate", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("view3d.move", {"type": 'TRACKPADPAN', "value": 'ANY', "shift": True}, None),
)),
("view3d.zoom", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "ctrl": True}, None),
("view3d.dolly", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "shift": True, "ctrl": True}, None),
@ -1022,9 +1027,6 @@ def km_view3d(params):
("view3d.view_selected", {"type": 'NUMPAD_PERIOD', "value": 'PRESS'},
{"properties": [("use_all_regions", False)]}),
("view3d.smoothview", {"type": 'TIMER1', "value": 'ANY', "any": True}, None),
("view3d.rotate", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
("view3d.rotate", {"type": 'MOUSEROTATE', "value": 'ANY'}, None),
("view3d.move", {"type": 'TRACKPADPAN', "value": 'ANY', "shift": True}, None),
("view3d.zoom", {"type": 'TRACKPADZOOM', "value": 'ANY'}, None),
("view3d.zoom", {"type": 'TRACKPADPAN', "value": 'ANY', "ctrl": True}, None),
("view3d.zoom", {"type": 'NUMPAD_PLUS', "value": 'PRESS'},