Skip to content

Commit

Permalink
Fix #3378: Navigation shortcuts (Alt-Left and Alt-Right) don't work w…
Browse files Browse the repository at this point in the history
…hen TreeView has focus
  • Loading branch information
siegfriedpammer committed Jan 28, 2025
1 parent e94eb91 commit 01d726c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ILSpy/Controls/TreeView/SharpTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,17 @@ protected override void OnKeyDown(KeyEventArgs e)
}
}
break;
case Key.System:
// https://github.com/icsharpcode/ILSpy/issues/3378:
// Behavior got broken when upgrading to .NET 8.0 for unknown reasons and without
// any more specific known cause. We fix it by not handling Alt+Left or Right
// in SharpTreeView so it is handled by the window.
if (e.SystemKey is Key.Left or Key.Right)
{
// yes, we do NOT call base.OnKeyDown(e); in this case.
return;
}
break;
}
if (!e.Handled)
base.OnKeyDown(e);
Expand Down

0 comments on commit 01d726c

Please sign in to comment.