metal3d / bashsimplecurses

A simple curses library made in bash to draw terminal interfaces
BSD 3-Clause "New" or "Revised" License
902 stars 117 forks source link

How I can read from stdin? #33

Open RatoX opened 6 years ago

RatoX commented 6 years ago

Hey everyone,

I'm trying to use this lib, btw is AWESOME, but I have no idea how I can read from the keyboard when I'm showing the information to the user.

e.g: If the user types the key r change the colors to red.

metal3d commented 6 years ago

Wow, nice idea !

The problem is that BSC is using a main loop to redraw, so you need to make a parallel waitkey function and I didn't tried to do. I will take a look, it's very interesting

vaidd4 commented 6 years ago

If you manage to do something like that, it would be possible to have some kind of text inputs or may be a menu selection. That would be awesome !

metal3d commented 1 year ago

In that case, whiptail and dialog are probably the best solution @vaidd4

@RatoX I think I've got an idea to implement "on_key" events.

But, keep in mind that BSC is not made to create interactive forms, we can implement some easy to use functionalities, but there are many others libraries to make complete TUI 😄