Support Home, End, PgUp, and PgDown in prompts

Closes #296
This commit is contained in:
Patrik Svensson 2021-03-14 22:49:15 +01:00 committed by Phil Scott
parent 8c099a0038
commit 57a8e6ccc1

View File

@ -47,6 +47,10 @@ namespace Spectre.Console
{ {
ConsoleKey.UpArrow => _index - 1, ConsoleKey.UpArrow => _index - 1,
ConsoleKey.DownArrow => _index + 1, ConsoleKey.DownArrow => _index + 1,
ConsoleKey.Home => 0,
ConsoleKey.End => _choices.Count - 1,
ConsoleKey.PageUp => _index - CalculatePageSize(_requestedPageSize),
ConsoleKey.PageDown => _index + CalculatePageSize(_requestedPageSize),
_ => _index, _ => _index,
}; };