[GH-ISSUE #490] Would like List shortcuts to call Changed() without calling Selected() #356

Closed
opened 2026-03-04 01:04:17 +03:00 by kerem · 2 comments
Owner

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.

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.
kerem closed this issue 2026-03-04 01:04:17 +03:00
Author
Owner

@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.

<!-- gh-comment-id:738967035 --> @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()`](https://pkg.go.dev/github.com/rivo/tview#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.
Author
Owner

@laduke commented on GitHub (Dec 7, 2020):

That helps. Thanks!

<!-- gh-comment-id:740200547 --> @laduke commented on GitHub (Dec 7, 2020): That helps. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#356
No description provided.