Keymap: use D-Key for view-pie menu

Use the D-key to access the view menu instead of the Tilda key,
which isn't accessible on some international layouts.

To resolve the conflicts the following changes have been made.

- `D` (motion) opens the view menu.
- `D` (mouse-button) uses grease-pencil (as it does currently).
- `Tilda` is used to for "Object Mode Transfer" instead of the View menu.

See T88092 for details.

Reviewed By: Severin

Ref D11189
This commit is contained in:
Campbell Barton 2021-06-02 21:32:25 +10:00
parent 69e15eb1e4
commit f92f5d1ac6
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by commit 757ec00f83, Revert "Keymap: use D-Key for view-pie menu"
Referenced by commit ca3891e83b, Fix T88828: View/Navigation(Walk/Fly) disappeared from keymap
Referenced by issue #88828, Blender 3.0 alpha : View/Navigation(Walk/Fly) dissapeared from Keymap
2 changed files with 32 additions and 14 deletions

View File

@ -103,8 +103,8 @@ class Prefs(bpy.types.KeyConfigPreferences):
v3d_tilde_action: EnumProperty(
name="Tilde Action",
items=(
('VIEW', "Navigate",
"View operations (useful for keyboards without a numpad)",
('OBJECT_SWITCH', "Object Switch",
"Switch the active object under the cursor (when not in object mode)",
0),
('GIZMO', "Gizmos",
"Control transform gizmos",
@ -113,7 +113,7 @@ class Prefs(bpy.types.KeyConfigPreferences):
description=(
"Action when 'Tilde' is pressed"
),
default='VIEW',
default='OBJECT_SWITCH',
update=update_fn,
)

View File

@ -1078,17 +1078,11 @@ def km_view3d(params):
{"properties": [("use_all_regions", True), ("center", False)]}),
("view3d.view_all", {"type": 'C', "value": 'PRESS', "shift": True},
{"properties": [("center", True)]}),
op_menu_pie(
"VIEW3D_MT_view_pie" if params.v3d_tilde_action == 'VIEW' else "VIEW3D_MT_transform_gizmo_pie",
{"type": 'ACCENT_GRAVE', "value": params.pie_value},
),
*(() if not params.use_pie_click_drag else
(("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'CLICK'}, None),)),
("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None),
op_menu_pie("VIEW3D_MT_view_pie", {"type": 'D', "value": 'CLICK_DRAG'}),
# Numpad views.
("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None),
("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS'},
{"properties": [("type", 'FRONT')]}),
("view3d.view_axis", {"type": 'NUMPAD_1', "value": 'PRESS'},
{"properties": [("type", 'FRONT')]}),
("view3d.view_orbit", {"type": 'NUMPAD_2', "value": 'PRESS', "repeat": True},
{"properties": [("type", 'ORBITDOWN')]}),
("view3d.view_axis", {"type": 'NUMPAD_3', "value": 'PRESS'},
@ -1327,6 +1321,32 @@ def km_view3d(params):
op_tool_cycle("builtin.select_box", {"type": 'W', "value": 'PRESS'}),
])
# Tilda key.
if params.use_pie_click_drag:
items.extend([
("object.transfer_mode",
{"type": 'ACCENT_GRAVE', "value": 'CLICK' if params.use_pie_click_drag else 'PRESS'},
None),
op_menu_pie(
"VIEW3D_MT_transform_gizmo_pie",
{"type": 'ACCENT_GRAVE', "value": 'CLICK_DRAG'},
)
])
else:
if params.v3d_tilde_action == 'OBJECT_SWITCH':
items.append(
("object.transfer_mode",
{"type": 'ACCENT_GRAVE', "value": 'PRESS'},
{"properties": [("use_eyedropper", False)]})
)
else:
items.append(
op_menu_pie(
"VIEW3D_MT_transform_gizmo_pie",
{"type": 'ACCENT_GRAVE', "value": 'PRESS'},
)
)
return keymap
@ -4484,8 +4504,6 @@ def km_sculpt(params):
)
items.extend([
# Transfer Sculpt Mode (release to avoid conflict with grease pencil drawing).
("object.transfer_mode", {"type": 'D', "value": 'RELEASE'}, None),
# Brush strokes
("sculpt.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),