Keymap: preference for fallback-tool with RMB select
Expose a key-map preference "Fallback Tool (RMB)", disabled by default. The right mouse button uses the fallback tool (currently visible selection tool in the toolbar), instead of always tweaking. When any selection tool is active, right mouse always tweaks. To enable fallback selection on RMB, set the "Right Mouse Select Action" to "Selection Tool". Internal changes: - Add fall-back key-maps, separate key-maps needed for when the tool is run as a fall-back. This is needed so RMB-select can support fall-back tools, so left-mouse can be used when it's the active tool and RMB can be used as a fall-back action when another tool is active. - Add options field to tools so tools without gizmos can enable the full-back tool keymap. - Support multiple key-maps for keymap handlers. - Fall-back keymaps now co-exist with the tool-keymaps. So both keymaps may be active at once - using different mouse buttons. When gizmos are in use, a highlighted gizmo prioritizes the tool-keymap over the fall-back keymap. Resolves T83690. Reviewed By: JulienKaspar Ref D12493
This commit is contained in:
@@ -105,6 +105,7 @@ class _defs_view3d_generic:
|
||||
icon="ops.generic.cursor",
|
||||
keymap="3D View Tool: Cursor",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -143,6 +144,7 @@ class _defs_view3d_generic:
|
||||
icon="ops.view3d.ruler",
|
||||
widget="VIEW3D_GGT_ruler",
|
||||
keymap="3D View Tool: Measure",
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
|
||||
@@ -237,6 +239,7 @@ class _defs_annotate:
|
||||
cursor='PAINT_BRUSH',
|
||||
keymap="Generic Tool: Annotate",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
||||
@@ -248,6 +251,7 @@ class _defs_annotate:
|
||||
cursor='PAINT_BRUSH',
|
||||
keymap="Generic Tool: Annotate Line",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn.with_args(draw_settings=draw_settings_common)
|
||||
@@ -259,6 +263,7 @@ class _defs_annotate:
|
||||
cursor='PAINT_BRUSH',
|
||||
keymap="Generic Tool: Annotate Polygon",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -274,6 +279,7 @@ class _defs_annotate:
|
||||
cursor='ERASER',
|
||||
keymap="Generic Tool: Annotate Eraser",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
|
||||
@@ -543,6 +549,7 @@ class _defs_view3d_add:
|
||||
widget="VIEW3D_GGT_placement",
|
||||
keymap="3D View Tool: Object, Add Primitive",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -569,6 +576,7 @@ class _defs_view3d_add:
|
||||
widget="VIEW3D_GGT_placement",
|
||||
keymap="3D View Tool: Object, Add Primitive",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -594,6 +602,7 @@ class _defs_view3d_add:
|
||||
widget="VIEW3D_GGT_placement",
|
||||
keymap="3D View Tool: Object, Add Primitive",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -619,6 +628,7 @@ class _defs_view3d_add:
|
||||
widget="VIEW3D_GGT_placement",
|
||||
keymap="3D View Tool: Object, Add Primitive",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -643,6 +653,7 @@ class _defs_view3d_add:
|
||||
widget="VIEW3D_GGT_placement",
|
||||
keymap="3D View Tool: Object, Add Primitive",
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
|
||||
@@ -1089,6 +1100,7 @@ class _defs_edit_mesh:
|
||||
widget=None,
|
||||
keymap=(),
|
||||
draw_settings=draw_settings,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -1695,6 +1707,7 @@ class _defs_image_generic:
|
||||
),
|
||||
icon="ops.generic.cursor",
|
||||
keymap=(),
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
# Currently a place holder so we can switch away from the annotation tool.
|
||||
@@ -1846,6 +1859,7 @@ class _defs_image_uv_edit:
|
||||
# TODO: generic operator (UV version of `VIEW3D_GGT_tool_generic_handle_free`).
|
||||
widget=None,
|
||||
keymap=(),
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
)
|
||||
|
||||
|
||||
@@ -1879,6 +1893,7 @@ class _defs_image_uv_sculpt:
|
||||
operator="sculpt.uv_sculpt_stroke",
|
||||
keymap="Image Editor Tool: Uv, Sculpt Stroke",
|
||||
draw_cursor=draw_cursor,
|
||||
options={'KEYMAP_FALLBACK'},
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user