mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 21:38:16 +08:00
Allow PACKET
key on MultiSelectionPrompt
This commit is contained in:
@ -160,7 +160,7 @@ public sealed class MultiSelectionPrompt<T> : IPrompt<List<T>>, IListPromptStrat
|
||||
return ListPromptInputResult.Submit;
|
||||
}
|
||||
|
||||
if (key.Key == ConsoleKey.Spacebar)
|
||||
if (key.Key == ConsoleKey.Spacebar || key.Key == ConsoleKey.Packet)
|
||||
{
|
||||
var current = state.Items[state.Index];
|
||||
var select = !current.IsSelected;
|
||||
|
@ -93,7 +93,7 @@ public sealed class SelectionPrompt<T> : IPrompt<T>, IListPromptStrategy<T>
|
||||
/// <inheritdoc/>
|
||||
ListPromptInputResult IListPromptStrategy<T>.HandleInput(ConsoleKeyInfo key, ListPromptState<T> state)
|
||||
{
|
||||
if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Spacebar)
|
||||
if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Spacebar || key.Key == ConsoleKey.Packet)
|
||||
{
|
||||
// Selecting a non leaf in "leaf mode" is not allowed
|
||||
if (state.Current.IsGroup && Mode == SelectionMode.Leaf)
|
||||
|
Reference in New Issue
Block a user