[GH-ISSUE #629] Extending keyboard/mouse events in List and Text view components #457

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

Originally created by @iberflow on GitHub (Jul 27, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/629

Hi there! Thank you for this amazing package, after going through your "competition" it seems like this is the most maintained and straightforward CLI UI out there.

I'm building an open-source manpage / command-line app documentation reader which will help developers interactively "analyze" various CLI commands and their flags.

Screenshot 2021-07-27 at 14 23 39

I've managed to make most of the basics work, but I really want to improve the UX of my tool before I release it. I've looked at the source code and I couldn't find a simple or any way to achieve what I want (I've only spent half the weekend digging around so maybe I missed something) and hope that maybe you could guide me in the right direction.

Sidebar (List component):

  • I want to make the left sidebar list select the element on up/down/tab keys rather than just highlight it. It should auto-select the item without having to press enter/space keys.
  • Mouse scroll doesn't scroll past the max height of the terminal after the selected element. I have to scroll, select a random item, scroll again to view the other list items.

Command and option description (TextView components):
I want to be able to click on a specific region and select the sidebar's list item that matches the highlighted region.

I've tried playing around with MouseHandler, WrapMouseHandler but I cannot access private properties from outside the struct so seems like it's a no-go, or I just don't understand how to use it properly.

My last attempt was to copy over TextView file and attempt to modify it, but due to internal private vars I would have to copy over more stuff and I'm not entirely sure that it would make it work.

I understand that my use case might be outside of what the project offers or has in mind for the future, but if I manage to achieve this and it's something that you see beneficial to your user base, I'd be more than happy to contribute to the project.

Any guidance is truly appreciated. Thanks!

Originally created by @iberflow on GitHub (Jul 27, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/629 Hi there! Thank you for this amazing package, after going through your "competition" it seems like this is the most maintained and straightforward CLI UI out there. I'm building an open-source manpage / command-line app documentation reader which will help developers interactively "analyze" various CLI commands and their flags. <img width="1056" alt="Screenshot 2021-07-27 at 14 23 39" src="https://user-images.githubusercontent.com/402965/127145806-166b345a-aafb-4bbb-8bd0-f18bfe9495d6.png"> I've managed to make most of the basics work, but I really want to improve the UX of my tool before I release it. I've looked at the source code and I couldn't find a simple or any way to achieve what I want (I've only spent half the weekend digging around so maybe I missed something) and hope that maybe you could guide me in the right direction. Sidebar (List component): - I want to make the left sidebar list select the element on up/down/tab keys rather than just highlight it. It should auto-select the item without having to press enter/space keys. - Mouse scroll doesn't scroll past the max height of the terminal after the selected element. I have to scroll, select a random item, scroll again to view the other list items. Command and option description (TextView components): I want to be able to click on a specific region and select the sidebar's list item that matches the highlighted region. I've tried playing around with `MouseHandler`, `WrapMouseHandler` but I cannot access private properties from outside the struct so seems like it's a no-go, or I just don't understand how to use it properly. My last attempt was to copy over TextView file and attempt to modify it, but due to internal private vars I would have to copy over more stuff and I'm not entirely sure that it would make it work. I understand that my use case might be outside of what the project offers or has in mind for the future, but if I manage to achieve this and it's something that you see beneficial to your user base, I'd be more than happy to contribute to the project. Any guidance is truly appreciated. Thanks!
kerem closed this issue 2026-03-04 01:05:10 +03:00
Author
Owner

@iberflow commented on GitHub (Jul 27, 2021):

I've managed to sort out my List related issues:
https://github.com/ignasbernotas/tview/tree/feature/list-select-on-navigation
https://github.com/ignasbernotas/tview/tree/feature/list-scroll-past-selected-item

Don't want to add more PRs since you documented that you'd like to discuss first, but I'll leave comments here for reference.

<!-- gh-comment-id:887660164 --> @iberflow commented on GitHub (Jul 27, 2021): I've managed to sort out my List related issues: https://github.com/ignasbernotas/tview/tree/feature/list-select-on-navigation https://github.com/ignasbernotas/tview/tree/feature/list-scroll-past-selected-item Don't want to add more PRs since you documented that you'd like to discuss first, but I'll leave comments here for reference.
Author
Owner

@rivo commented on GitHub (Feb 15, 2022):

My apologies for getting to this so late. Are these items still relevant to you, i.e. do you need me to look into them?

<!-- gh-comment-id:1040309181 --> @rivo commented on GitHub (Feb 15, 2022): My apologies for getting to this so late. Are these items still relevant to you, i.e. do you need me to look into them?
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#457
No description provided.