bashsimplecurses icon indicating copy to clipboard operation
bashsimplecurses copied to clipboard

How I can read from stdin?

Open RatoX opened this issue 6 years ago • 3 comments

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.

RatoX avatar Aug 31 '18 15:08 RatoX

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

metal3d avatar Sep 12 '18 07:09 metal3d

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 !

vaidd4 avatar Sep 12 '18 14:09 vaidd4

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 😄

metal3d avatar May 20 '23 09:05 metal3d