Skip to content

Commit 01d726c

Browse files
Fix #3378: Navigation shortcuts (Alt-Left and Alt-Right) don't work when TreeView has focus
1 parent e94eb91 commit 01d726c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ILSpy/Controls/TreeView/SharpTreeView.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,17 @@ protected override void OnKeyDown(KeyEventArgs e)
361361
}
362362
}
363363
break;
364+
case Key.System:
365+
// https://github.com/icsharpcode/ILSpy/issues/3378:
366+
// Behavior got broken when upgrading to .NET 8.0 for unknown reasons and without
367+
// any more specific known cause. We fix it by not handling Alt+Left or Right
368+
// in SharpTreeView so it is handled by the window.
369+
if (e.SystemKey is Key.Left or Key.Right)
370+
{
371+
// yes, we do NOT call base.OnKeyDown(e); in this case.
372+
return;
373+
}
374+
break;
364375
}
365376
if (!e.Handled)
366377
base.OnKeyDown(e);

0 commit comments

Comments
 (0)