From 926b2f6887f8c91b7bd1cca9b8c0671ea2678e5b Mon Sep 17 00:00:00 2001 From: niksedk Date: Wed, 10 Nov 2021 08:53:10 +0100 Subject: [PATCH] Fix navigating to the start/end of the file in list view from the text box - thx darnn :) Fix #5452 --- src/ui/Forms/Main.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index aae667705..f47d50d7c 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -10238,6 +10238,18 @@ namespace Nikse.SubtitleEdit.Forms e.SuppressKeyPress = true; } + //TODO: add these two to custom shortcuts + else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.Home) + { + SelectListViewIndexAndEnsureVisible(0); + e.SuppressKeyPress = true; + } + else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.End) + { + SelectListViewIndexAndEnsureVisible(SubtitleListview1.Items.Count - 1); + e.SuppressKeyPress = true; + } + // last key down in text _lastTextKeyDownTicks = DateTime.UtcNow.Ticks; @@ -26449,6 +26461,18 @@ namespace Nikse.SubtitleEdit.Forms e.SuppressKeyPress = true; } + //TODO: add these two to custom shortcuts + else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.Home) + { + SelectListViewIndexAndEnsureVisible(0); + e.SuppressKeyPress = true; + } + else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.End) + { + SelectListViewIndexAndEnsureVisible(SubtitleListview1.Items.Count - 1); + e.SuppressKeyPress = true; + } + // last key down in text _lastTextKeyDownTicks = DateTime.UtcNow.Ticks;