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