Fix navigating to the start/end of the file in list view from the text box - thx darnn :)

Fix #5452
This commit is contained in:
niksedk 2021-11-10 08:53:10 +01:00
parent f679db8b76
commit 926b2f6887

View File

@ -10238,6 +10238,18 @@ namespace Nikse.SubtitleEdit.Forms
e.SuppressKeyPress = true; 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 // last key down in text
_lastTextKeyDownTicks = DateTime.UtcNow.Ticks; _lastTextKeyDownTicks = DateTime.UtcNow.Ticks;
@ -26449,6 +26461,18 @@ namespace Nikse.SubtitleEdit.Forms
e.SuppressKeyPress = true; 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 // last key down in text
_lastTextKeyDownTicks = DateTime.UtcNow.Ticks; _lastTextKeyDownTicks = DateTime.UtcNow.Ticks;