[GH-ISSUE #13] Feature request: Mouse support #9

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

Originally created by @pjebs on GitHub (Jan 11, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/13

Originally created by @pjebs on GitHub (Jan 11, 2018). Original GitHub issue: https://github.com/rivo/tview/issues/13
kerem 2026-03-04 01:01:04 +03:00
Author
Owner

@tjstebbing commented on GitHub (Nov 6, 2018):

How would you like this to look?

func (b *Box) SetMouseCapture(capture func(event *tcell.EventMouse) *tcell.EventMouse) *Box
<!-- gh-comment-id:436243289 --> @tjstebbing commented on GitHub (Nov 6, 2018): How would you like this to look? ```go func (b *Box) SetMouseCapture(capture func(event *tcell.EventMouse) *tcell.EventMouse) *Box ```
Author
Owner

@rivo commented on GitHub (Nov 10, 2018):

There will be probably something like this. But mouse support should be much more than that. If I click on an input field, it should receive focus and allow me to edit it. If I click on a button, it should be activated. Any primitive should receive focus when clicked on. Things like that.

It's a higher effort, which is why I haven't gotten around to implementing it yet.

<!-- gh-comment-id:437578756 --> @rivo commented on GitHub (Nov 10, 2018): There will be probably something like this. But mouse support should be much more than that. If I click on an input field, it should receive focus and allow me to edit it. If I click on a button, it should be activated. Any primitive should receive focus when clicked on. Things like that. It's a higher effort, which is why I haven't gotten around to implementing it yet.
Author
Owner

@markx commented on GitHub (Mar 12, 2019):

It'll be nice to setup some ground work like a basic or even empty handler, so we can easily implement the function locally before there's global support for all primitives.

<!-- gh-comment-id:472204421 --> @markx commented on GitHub (Mar 12, 2019): It'll be nice to setup some ground work like a basic or even empty handler, so we can easily implement the function locally before there's global support for all primitives.
Author
Owner

@diamondburned commented on GitHub (Apr 22, 2019):

@markx check out @Bios-Marcel's https://github.com/Bios-Marcel/tview/ repository. Perhaps you could cherry-pick some commits into a PR 👀

<!-- gh-comment-id:485437463 --> @diamondburned commented on GitHub (Apr 22, 2019): @markx check out @Bios-Marcel's https://github.com/Bios-Marcel/tview/ repository. Perhaps you could cherry-pick some commits into a PR 👀
Author
Owner

@Bios-Marcel commented on GitHub (Apr 22, 2019):

Duh, now I gotta talk about this.

My mouse support isn't wellfully implemented:

  • It breaks terminal selection
  • No focus on click (you gotta add that for yourself if you want it)
  • Only Button and List handle clicks by default
  • Scrolling isn't handled

I was just trying to get something without putting in much effort, which is also why I don't PR this back into rivo/tview.

<!-- gh-comment-id:485438153 --> @Bios-Marcel commented on GitHub (Apr 22, 2019): Duh, now I gotta talk about this. My mouse support isn't ~~well~~fully implemented: * It breaks terminal selection * No focus on click (you gotta add that for yourself if you want it) * Only `Button` and `List` handle clicks by default * Scrolling isn't handled I was just trying to get something without putting in much effort, which is also why I don't PR this back into rivo/tview.
Author
Owner

@antonmedv commented on GitHub (Oct 31, 2019):

Hi @rivo,

Any plans add this feature? :)

<!-- gh-comment-id:548260395 --> @antonmedv commented on GitHub (Oct 31, 2019): Hi @rivo, Any plans add this feature? :)
Author
Owner

@rivo commented on GitHub (Mar 29, 2020):

Mouse support has been added. Please have a look and let me know in case you find any bugs.

<!-- gh-comment-id:605689524 --> @rivo commented on GitHub (Mar 29, 2020): Mouse support has been added. Please have a look and let me know in case you find any bugs.
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#9
No description provided.