mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #490] Would like List shortcuts to call Changed() without calling Selected() #356
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#356
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @laduke on GitHub (Aug 22, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/490
I'm just getting started with the library. It's really cool though! I'm making a little two pane thing. List on the left, details on the right.
If I use the rune shortcuts, or the mouse, to jump around in the list, the Selected() function gets called. If I use the arrow keys, only Changed() gets called.
I'd like only Changed() to get called when I use shortcuts, so I can update the details view to show the selected item.
I want to "launch the missiles" only when Enter is pressed on a list item.
I still have little knowledge about this project and may end up using treeview or table or something for the "list" pane anyways (the shortcuts are nice though), so please just close without comment if this doesn't make any sense.
@rivo commented on GitHub (Dec 4, 2020):
There's no simple way to do this. A shortcut will "launch the missiles". That's why I called it a "shortcut". You can override your shortcuts with
Box.SetInputCapture(). It would allow you to achieve what you're asking for. But you'd have to encode the shortcuts on your end instead of relying on existing functionality.Let me know if this helps you.
@laduke commented on GitHub (Dec 7, 2020):
That helps. Thanks!