-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "Auto Move To Next Item" in ListView #1962
Comments
Most
If we were to implement this it would mean a user could bind If API user wants it to always move next on check then they can just rebind the key for What do you think? |
Another option I guess would be to expand keybinding so you could send multiple commands e.g.
Above is pseudocode for how user might call this Not sure how hard that would be but might be more elegant and versatile? |
I half-considered this when typing the above. I think it's an intriguing idea. The implications are huge, though: Chaining commands is the camel's-nose-under-the-tent of building Turing complete scripting system. LOL. Before long peeps would be asking for a "delay command" and "conditional commands" etc... So we should tread carefully in this direction. Since you know the |
When I started writing this Issue, I actually had it titled "All Views should support 'ToggleAndMoveNext`". So I'm a fan of this concept. |
To summarize ideas so far:
I'd like to have a discussion as to why #1 might be a bad idea. I haven't thought enough about it, but I have some instinct that says it might be bad. But at the same time I like it. |
Regarding 1
I had intended
That said a myView.ClearKeybinding (Command.ToggleChecked);
myView.KeyPress += (e)=>
{
// switch toggle state
// move next item
}; Also a (maybe not very good) reason its Regarding 2 and 3I will take a look at chaining commands, I think it will be quite easy and should have quite a small footprint. Thinking about it more now, Im not sure having a new Command that is implicitly 2 operations joined together ( The more Enum values in |
ListView
supports multi-select; SPACE toggles (@tznind I don't see a sample ofTableView
demonstrating multi-select).In
Out-ConsoleGridView
a user has requested that when in multi-select mode (-OutputMode Multiple
) pressing SPACE to select will toggle the item and move to the next row: PowerShell/ConsoleGuiTools#148I don't see how to implement this in a generic/extensible way.
Ideally, I'd be able to (in
Out-ConsoleGridView
) define a newCommand
be added namedToggleCheckedWithKey
:But
Command
is notpublic
, so this won't work.We could modify
ListView
:But this means that if
Command.ToggleChecked
is invoked in a way OTHER than the SPACE key theMoveDown
will happen, which is not what we want. Also, we have all thisCommand
andKeyBinding
functionality, and it seems crazy to have to add yet-another-option toListView
.What are the best ideas for addressing this?
The text was updated successfully, but these errors were encountered: