ccbrown / iocraft

A Rust crate for beautiful, artisanally crafted CLIs, TUIs, and text-based IO.
https://crates.io/crates/iocraft
Apache License 2.0
339 stars 5 forks source link

Add support for mouse events #17

Closed ccbrown closed 1 month ago

ccbrown commented 1 month ago

It would be great to be able to click, scroll, hover, etc. with the mouse.

Implementing this support for fullscreen mode is pretty trivial. The problem is...

Is there a robust way to accomplish this? Are there other libraries that do it well?

skreborn commented 1 month ago

I would argue that these features don't make much sense in a non-fullscreen application in the first place, so perhaps the way forward is simply to reserve this functionality to those that have real use for it. Is it really worth trying to find workarounds? Is there a use-case to consider?

ccbrown commented 1 month ago

Good question. I don't have any particularly strong use-cases in mind other than "clickable buttons and text fields might look nice", so perhaps the way to go is to start with implementing this for fullscreen mode and see what use-cases aren't met after that.

ccbrown commented 1 month ago

The next release will have support for mouse events and to demonstrate it, there's a new calculator example:

calculator