feat(preview): right-click is the menu, zoom is the single-handed gesture

Creator ruling 2026-11-01, and the reason is live-stream ergonomics: no two-handed
chords while a broadcast or recording is running.

- Edit mode: left selects / drags / resizes, right opens the context menu, Ctrl+right
  toggles the zoom box. Chords are acceptable here because editing is a stopped activity.
- Preview mode: left toggles the zoom box, right opens the context menu, and Ctrl+right
  is swallowed outright — handled rather than left to fall through, so Ctrl+right cannot
  open a menu by accident while one hand is on the mouse.

This also removes the old live behaviour where right-click activated the magnifier at the
cursor point (and dismissed it). Zoom in preview is now a plain toggle; if point-zoom is
wanted back it needs a one-button gesture, not a chord.

Build: Release 0 warnings. Debug is currently blocked by the running app holding the exe
(PID 47252) — close it and the Debug build copies normally.
This commit is contained in:
2026-11-01 08:10:04 -08:00
parent fdb27f0758
commit 279eb08dea
2 changed files with 22 additions and 19 deletions
+21 -19
View File
@@ -451,7 +451,17 @@ public partial class PreviewPane : UserControl
private void Preview_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var vm = DataContext as MainViewModel;
if (vm is null || !vm.IsEditMode) return;
if (vm is null) return;
// Preview mode (EDIT off): the left button drives the zoom box — the common gesture in
// the mode where nothing is editable. Dragging it afterwards is handled by MouseMove.
if (!vm.IsEditMode)
{
vm.ToggleZoom();
e.Handled = true;
return;
}
var grid = (Grid)sender;
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
var p = toCanvas.Transform(e.GetPosition(grid));
@@ -576,29 +586,21 @@ public partial class PreviewPane : UserControl
private void Preview_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
// Ctrl + right-click opens the element / backdrop context menu — sources and windows can
// be changed at ANY time, live or not (creator ruling 2026-10-30). Plain right-click stays
// with the zoom box, which is why the menu needed its own chord.
// Returning without Handled lets WPF's ContextMenuService open the menu under the cursor.
if ((Keyboard.Modifiers & ModifierKeys.Control) != 0) return;
// Right-click = the context menu, in both modes (creator ruling 2026-11-01).
// Ctrl+right-click = the zoom box, EDIT MODE ONLY: the creator asked for no two-handed
// chords while live or recording, so the preview swallows Ctrl+right-click instead of
// letting it fall through to the menu. Returning without Handled is what lets WPF's
// ContextMenuService open the menu under the cursor.
var vm = DataContext as MainViewModel;
if (vm == null) return;
var grid = (Grid)sender;
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
var p = toCanvas.Transform(e.GetPosition(grid));
if ((vm.IsLive || vm.IsRecording) && !vm.IsEditMode)
if (vm is null) return;
if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) return;
if (!vm.IsEditMode)
{
if (vm.IsZoomActive)
{
vm.DismissZoom();
e.Handled = true;
return;
}
vm.ActivateZoom(p.X, p.Y);
e.Handled = true;
return;
}
vm.ToggleZoom();
e.Handled = true;
} private void Preview_MouseRightButtonUp(object sender, MouseButtonEventArgs e)