Skip to content
Discussion options

You must be logged in to vote

@ig-perez @Cristianasp To answer both your questions...

Rich doesn't yet handle keyboard input, other than Input() (or Prompt.ask). Unfortunately input() is unlikely to work well with Live.

@Cristianasp Your idea of using using pynput is probably a good one (although I haven't tried myself). No need to write to files though. What I would suggest you do is put your logic inside on_press. Update layout["whatever"] there.

Your live loop need only do something like the following:

with Live(layout, screen=True):
    while True:
        sleep(1)

Hope that helps!

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Cristianasp
Comment options

@ig-perez
Comment options

Answer selected by ig-perez
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants